* added some example tests
This commit is contained in:
30
test/AppTest/Action/CiConfigFactoryTest.php
Normal file
30
test/AppTest/Action/CiConfigFactoryTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace AppTest\Action;
|
||||
|
||||
use App\Action\CiConfigAction;
|
||||
use App\Action\CiConfigFactory;
|
||||
use App\Service\CiConfigService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class CiConfigFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** @var ContainerInterface */
|
||||
protected $container;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->container = $this->prophesize(ContainerInterface::class);
|
||||
$ciConfigService = $this->prophesize(CiConfigService::class);
|
||||
|
||||
$this->container->get(CiConfigService::class)->willReturn($ciConfigService);
|
||||
}
|
||||
|
||||
public function testFactory()
|
||||
{
|
||||
$factory = new CiConfigFactory();
|
||||
$this->assertTrue($factory instanceof CiConfigFactory);
|
||||
$actionPage = $factory($this->container->reveal());
|
||||
$this->assertTrue($actionPage instanceof CiConfigAction);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user