for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
*
* (c) Yaroslav Honcharuk <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yarhon\RouteGuardBundle\Tests\DependencyInjection\Container;
use PHPUnit\Framework\TestCase;
use Yarhon\RouteGuardBundle\DependencyInjection\Container\ClassMap;
use Yarhon\RouteGuardBundle\Exception\InvalidArgumentException;
/**
* @author Yaroslav Honcharuk <[email protected]>
class ClassMapTest extends TestCase
{
public function testHas()
$map = new ClassMap(['test1' => 'class_name']);
$this->assertTrue($map->has('test1'));
$this->assertFalse($map->has('test2'));
}
public function testGet()
$this->assertEquals('class_name', $map->get('test1'));
public function testGetException()
$this->expectException(InvalidArgumentException::class);
$map->get('test2');