public function testSilencedDeprecation($callback) { $this->
expectDeprecation('Drupal\Tests\Core\Security\UntrustedObject::callback is not trusted'
);
$this->
doTrustedCallback($callback,
[], '%s is not trusted', TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION
);
} /**
* @dataProvider errorTypeProvider
*/
public function testWarning($callback) { $this->
expectWarning();
$this->
expectWarningMessage('Drupal\Tests\Core\Security\UntrustedObject::callback is not trusted'
);
$this->
doTrustedCallback($callback,
[], '%s is not trusted', TrustedCallbackInterface::TRIGGER_WARNING
);
} /**
* Data provider for tests of ::doTrustedCallback $error_type argument.
*/
public function errorTypeProvider() { $tests['untrusted_object'
] =
[[new UntrustedObject(), 'callback'
]];
$tests['untrusted_object_static_string'
] =
['Drupal\Tests\Core\Security\UntrustedObject::callback'
];
$tests['untrusted_object_static_array'
] =
[[UntrustedObject::
class, 'callback'
]];
return $tests;
}