for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Opine;
use PHPUnit_Framework_TestCase;
use Opine\Container\Service as Container;
use Opine\Config\Service as Config;
class BuildTest extends PHPUnit_Framework_TestCase
{
private $build;
public function setup()
$root = __DIR__.'/../public';
$config = new Config($root);
$config->cacheSet();
$this->container = Container::instance($root, $config, $root.'/../config/containers/test-container.yml');
container
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
$this->build = $this->container->get('build');
}
public function testBuild()
$cache = $this->build->project();
$this->assertTrue(isset($cache['collections']));
$this->assertTrue(isset($cache['forms']));
$this->assertTrue(isset($cache['bundles']));
$this->assertTrue(isset($cache['topics']));
$this->assertTrue(isset($cache['routes']));
$this->assertTrue(isset($cache['container']));
$this->assertTrue(isset($cache['languages']));
$this->assertTrue(isset($cache['config']));
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: