public function testGet() { $item = new ehough_stash_Item(); $poolStub = new ehough_stash_test_stub_PoolGetDriverStub(); $poolStub->setDriver(new ehough_stash_test_stub_DriverExceptionStub()); $item->setPool($poolStub); $item->setKey(array('path', 'to', 'get')); $this->assertFalse($item->isDisabled()); $this->assertNull($item->get()); $this->assertTrue($item->isDisabled(), 'Is disabled after exception is thrown in driver'); }
public function testKeyCollisions2() { $driver = new $this->driverClass(); $poolStub = new ehough_stash_test_stub_PoolGetDriverStub(); $poolStub->setDriver($driver); $item1 = new ehough_stash_Item(); $item1->setPool($poolStub); $item1->setKey(array('#')); $item1->set('X'); $item2 = new ehough_stash_Item(); $item2->setPool($poolStub); $item2->setKey(array(':')); $item2->set('Y'); $this->assertEquals('X', $item1->get()); }