-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82615c8
commit 97c880c
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Presque package. | ||
* | ||
* (c) Justin Rainbow <justin.rainbow@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Presque\Tests\Storage; | ||
|
||
use Presque\Tests\TestCase; | ||
use Presque\Storage\StorageFactory; | ||
use Mockery as m; | ||
|
||
class StorageFactoryTest extends TestCase | ||
{ | ||
/** | ||
* @expectedException InvalidArgumentException | ||
*/ | ||
public function testFailingToCreateStorage() | ||
{ | ||
StorageFactory::create('tcp://:6379'); | ||
} | ||
|
||
public function testCreatingStorageWithPrefix() | ||
{ | ||
try { | ||
$storage = StorageFactory::create('tcp://localhost:6379', 'test'); | ||
|
||
$this->assertInstanceOf('Presque\Storage\StorageInterface', $storage); | ||
$this->assertEquals('test', $storage->getPrefix()); | ||
} catch (\RedisException $e) { | ||
// this is OK - redis might not be running! | ||
} | ||
} | ||
|
||
public function testCreatingStorage() | ||
{ | ||
try { | ||
$storage = StorageFactory::create('tcp://localhost:6379'); | ||
|
||
$this->assertInstanceOf('Presque\Storage\StorageInterface', $storage); | ||
} catch (\RedisException $e) { | ||
// this is OK - redis might not be running! | ||
} | ||
} | ||
} |