for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the CLIFramework package.
*
* (c) Arnaud VEBER <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CLIFramework;
use CLIFramework\Kernel;
class KernelTest extends \PHPUnit_Framework_TestCase
{
* test construct.
* @param string $environment
* @param bool $debug
* @dataProvider constructProvider
public function testConstruct($environment, $debug)
// create kernel
$kernel = new Kernel($environment, $debug);
// assert
$this->assertInstanceOf('\CLIFramework\Kernel', $kernel);
$this->assertEquals($environment, $kernel->getEnvironment());
$this->assertEquals($debug, $kernel->isDebug());
}
* test register bundles
public function testRegisterBundles()
$kernel = new Kernel('test', true);
// register bundles
$bundles = $kernel->registerBundles();
$this->assertInstanceOf('\Symfony\Bundle\MonologBundle\MonologBundle', $bundles[0]);
* construct provider.
* @return array
array<string|boolean>[]
This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.
array
public function constructProvider()
return array(
array('test', true),
array('test', false),
array('dev', true),
array('dev', false),
array('prod', true),
array('prod', false),
);
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.