Skip to content

Commit

Permalink
Test added for pool getter setters
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbowers committed Apr 3, 2015
1 parent fde4333 commit 98c1eca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Stash/Test/AbstractPoolTest.php
Expand Up @@ -11,6 +11,7 @@

namespace Stash\Test;

use Stash\Mode;
use Stash\Pool;
use Stash\Driver\Ephemeral;
use Stash\Test\Stubs\LoggerStub;
Expand Down Expand Up @@ -66,6 +67,21 @@ public function testGetItem()
$this->assertAttributeEquals('TestNamespace', 'namespace', $item, 'Pool sets Item namespace.');
}

public function testModeGetterSetters()
{
$pool = $this->getTestPool();

$mode_set = Mode::DISABLED;

$mode = $pool->setMode($mode_set);

$this->assertTrue($mode, 'Mode should return true upon being set.');

$mode_returned = $pool->getMode();

$this->assertTrue($mode_set === $mode_returned, 'The returned mode is not the same as the set mode');
}

/**
* @expectedException InvalidArgumentException
* @expectedExceptionMessage Item constructor requires a key.
Expand Down

0 comments on commit 98c1eca

Please sign in to comment.