* initial commit

* get list of activities
* get activity by id
This commit is contained in:
Dávid Danyi
2017-01-27 16:45:14 +01:00
commit b5c307166e
31 changed files with 3299 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace AppTest\Action;
use App\Action\HomePageAction;
use App\Action\HomePageFactory;
use Interop\Container\ContainerInterface;
use Zend\Expressive\Router\RouterInterface;
use Zend\Expressive\Template\TemplateRendererInterface;
class HomePageFactoryTest extends \PHPUnit_Framework_TestCase
{
/** @var ContainerInterface */
protected $container;
protected function setUp()
{
$this->container = $this->prophesize(ContainerInterface::class);
$router = $this->prophesize(RouterInterface::class);
$this->container->get(RouterInterface::class)->willReturn($router);
}
public function testFactoryWithoutTemplate()
{
$factory = new HomePageFactory();
$this->container->has(TemplateRendererInterface::class)->willReturn(false);
$this->assertTrue($factory instanceof HomePageFactory);
$homePage = $factory($this->container->reveal());
$this->assertTrue($homePage instanceof HomePageAction);
}
public function testFactoryWithTemplate()
{
$factory = new HomePageFactory();
$this->container->has(TemplateRendererInterface::class)->willReturn(true);
$this->container
->get(TemplateRendererInterface::class)
->willReturn($this->prophesize(TemplateRendererInterface::class));
$this->assertTrue($factory instanceof HomePageFactory);
$homePage = $factory($this->container->reveal());
$this->assertTrue($homePage instanceof HomePageAction);
}
}