for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Basis\Application;
use Basis\Converter;
use League\Container\Container;
class ApplicationTest extends TestSuite
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
public function testApplication()
$this->assertNotNull($this->app);
app
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->assertInstanceOf(Application::class, $this->app);
$this->assertSame($this->app, $this->app->get(Application::class));
$container = $this->app->get(Container::class);
$this->assertInstanceOf(Container::class, $container);
$this->assertSame($this->app, $container->get(Application::class));
}
public function testAssets()
$assets = $this->app->dispatch('module.assets');
$this->assertArrayHasKey('hash', $assets);
$this->assertArrayHasKey('js', $assets);
$this->assertArrayHasKey('test.js', $assets['js']);
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.