12use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
13use PHPUnit\Framework\TestCase;
15require_once(
'./libs/composer/vendor/autoload.php');
29 use MockeryPHPUnitIntegration;
56 $this->plugin_mock = Mockery::mock(ilPlugin::class);
58 $this->provider_mock = Mockery::mock(Provider::class);
59 $this->provider_mock->shouldReceive(
'getProviderNameForPresentation')->andReturn(
'Provider')->byDefault();
61 $this->provider_factory = Mockery::mock(ProviderFactoryInterface::class);
62 $this->provider_factory->shouldReceive(
'getProviderByClassName')->with(self::MOCKED_PROVIDER_CLASSNAME)->andReturn($this->provider_mock);
63 $this->provider_factory->shouldReceive(
'isInstanceCreationPossible')->andReturn(
true);
64 $this->provider_factory->shouldReceive(
'isRegistered')->andReturn(
true);
73 $this->expectException(\LogicException::class);
74 $this->identification->core($this->provider_mock)->identifier($string);
81 $this->identification->core($this->provider_mock)->identifier($string);
An exception for terminatinating execution or to throw for unit testing.
Class IdentificationFactory.
Class IdentificationFactoryTest.
testMustThrowExceptionSinceSerializedIdentificationIsTooLong()
const MOCKED_PROVIDER_CLASSNAME
testMustNotThrowExceptionSinceSerializedIdentificationIsExactLength()
Interface SerializerInterface.
Interface ProviderFactoryInterface.