Moved and renamed functional tests. Simplified ConfigurationTest
This commit is contained in:
43
Tests/FilesystemMapTest.php
Normal file
43
Tests/FilesystemMapTest.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Knp\Bundle\GaufretteBundle\Tests;
|
||||
|
||||
use Knp\Bundle\GaufretteBundle\FilesystemMap;
|
||||
|
||||
class FilesystemMapTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $filesystemMap;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->filesystemMap = new FilesystemMap(array('amazon_fs' => $this->getFilesystem(), 'local_fs' => $this->getFilesystem()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldGetFilesystemByKey()
|
||||
{
|
||||
$this->assertInstanceOf('Gaufrette\Filesystem', $this->filesystemMap->get('amazon_fs'), 'should get filesystem object by key');
|
||||
$this->assertInstanceOf('Gaufrette\Filesystem', $this->filesystemMap->get('local_fs'), 'should get filesystem object by key');
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function shouldNotGetFilesystemWhenKeyWasNotSet()
|
||||
{
|
||||
$this->filesystemMap->get('test');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Gaufrette\Filesystem
|
||||
*/
|
||||
private function getFilesystem()
|
||||
{
|
||||
return $this->getMockBuilder('Gaufrette\Filesystem')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user