예제 #1
0
 public function testQueueValidNonBooleanYesChange()
 {
     $this->_mockOptionsReference->shouldReceive('isMeantToBePersisted')->once()->with('name')->andReturn(true);
     $this->_mockOptionsReference->shouldReceive('isBoolean')->once()->with('name')->andReturn(false);
     $this->_mockOptionsReference->shouldReceive('getAllOptionNames')->once()->andReturn(array('name'));
     $this->_mockBackend->shouldReceive('fetchAllCurrentlyKnownOptionNamesToValues')->twice()->andReturn(array('name' => 'value2'), array('name' => 'VALUE'));
     $this->_mockBackend->shouldReceive('saveAll')->once()->with(array('name' => 'VALUE'))->andReturnNull();
     $this->setupEventDispatcherToPass('name', 'value', 'VALUE');
     $result = $this->_sut->queueForSave('name', 'value');
     $this->assertNull($result);
     $result = $this->_sut->flushSaveQueue();
     $this->assertNull($result);
     $this->assertEquals('VALUE', $this->_sut->fetch('name'));
 }