Skip to content

Commit 2a186e9

Browse files
author
Andrew Carter
committed
Created test for application factory
1 parent 0e06daf commit 2a186e9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/ApplicationFactoryTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace PHPFastCGI\Test\FastCGIDaemon;
4+
5+
use PHPFastCGI\FastCGIDaemon\ApplicationFactory;
6+
7+
/**
8+
* Tests the daemon.
9+
*/
10+
class ApplicationFactoryTest extends \PHPUnit_Framework_TestCase
11+
{
12+
/**
13+
* Tests that the factory can create a Symfony console application
14+
*/
15+
public function testCreateApplication()
16+
{
17+
$applicationFactory = new ApplicationFactory;
18+
19+
$name = 'foo';
20+
$description = 'bar';
21+
22+
$application = $applicationFactory->createApplication(function () { }, $name, $description);
23+
24+
$this->assertInstanceOf('Symfony\\Component\\Console\\Application', $application);
25+
$this->assertTrue($application->has($name));
26+
$this->assertEquals($description, $application->get($name)->getDescription());
27+
}
28+
}

0 commit comments

Comments
 (0)