for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mosaic\Filesystem\Tests;
use Mosaic\Common\Conventions\DefaultFolderStructure;
use Mosaic\Filesystem\Adapters\Flysystem\DiskResolverCollection;
use Mosaic\Filesystem\Component;
use Mosaic\Filesystem\Providers\FlystemProvider;
class ComponentTest extends \PHPUnit_Framework_TestCase
{
public function test_can_ask_for_flystem_implementation()
$component = Component::flystem(new DefaultFolderStructure('/'));
$this->assertInstanceOf(\Mosaic\Filesystem\Adapters\Flysystem\Component::class, $component);
}
public function test_can_ask_for_custom_implementation()
Component::extend('custom', function ($folder) {
$folder
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return [
new FlystemProvider(new DiskResolverCollection)
];
});
$component = Component::custom(new DefaultFolderStructure('/'));
custom()
Mosaic\Filesystem\Component
resolveCustom()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
$this->assertEquals('custom', $component->getImplementation());
$this->assertInstanceOf(Component::class, $component);
$this->assertCount(1, $component->getProviders());
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.