Skip to content

Instantly share code, notes, and snippets.

@knyga
Created March 17, 2017 21:57
Show Gist options
  • Save knyga/2ab3eea6e97b0f1d1f38c3a94ffcc357 to your computer and use it in GitHub Desktop.
Save knyga/2ab3eea6e97b0f1d1f38c3a94ffcc357 to your computer and use it in GitHub Desktop.
StashDriverFactoryTest.php
<?php
namespace WebExtractor\Test;
use WebExtractor\StashDriverFactory\StashDriverFactory;
/**
* Class StashDriverFactoryTest
*
* @package WebExtractor\Test\Hander
*/
class StashDriverFactoryTest extends AbstractTestCase {
private $factory;
protected function setUp()
{
$this->factory = StashDriverFactory::getEntity();
}
public function testCreate() {
$driver = $this->factory->createDriver("FileSystem");
$this->assertInstanceOf('Stash\Driver\FileSystem', $driver);
}
public function testCreateCaseSensetivity() {
$driver = $this->factory->createDriver("BlackHole");
$this->assertInstanceOf('Stash\Driver\BlackHole', $driver);
$driver = $this->factory->createDriver("blackhole");
$this->assertInstanceOf('Stash\Driver\BlackHole', $driver);
}
/**
* @expectedException WebExtractor\StashDriverFactory\Exception\DriverNotFoundException
*/
public function testCreateDriverNotFoundException() {
$name = "myDriver";
$this->factory->createDriver($name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment