/var/www/vhosts/ihelp.ro/httpdocs/vendor/mirko-pagliai/php-tools/tests/TestCase/Event
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/mirko-pagliai/php-tools/tests/TestCase/Event/EventTest.php (1956B)
Event ??= new Event('myEvent', ['arg1', 'arg2']);
}
/**
* @test
* @uses \Tools\Event\Event::getName()
*/
public function testGetName(): void
{
$this->assertSame('myEvent', $this->Event->getName());
}
/**
* @test
* @uses \Tools\Event\Event::getArg()
*/
public function testGetArg(): void
{
$this->assertSame('arg1', $this->Event->getArg(0));
$this->assertSame('arg2', $this->Event->getArg(1));
$this->expectException(KeyNotExistsException::class);
$this->expectExceptionMessage('Argument with index `2` does not exist');
$this->assertSame('arg2', $this->Event->getArg(2));
}
/**
* @test
* @uses \Tools\Event\Event::getArgs()
*/
public function testGetArgs(): void
{
$this->assertSame(['arg1', 'arg2'], $this->Event->getArgs());
$Mock = $this->createStub(\stdClass::class);
$Event = new Event('myEvent', $Mock);
$this->assertIsArray($Event->getArgs());
$this->assertNotEmpty($Event->getArgs());
}
}