public function testQueueValidNonBooleanNoChange()
 {
     $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')->once()->andReturn(array('name' => 'VALUE'));
     $this->setupEventDispatcherToPass('name', 'value', 'VALUE');
     $result = $this->_sut->queueForSave('name', 'value');
     $this->assertNull($result);
     $result = $this->_sut->flushSaveQueue();
     $this->assertNull($result);
 }
Exemple #2
0
 private function _flushPersistence()
 {
     foreach ($this->_multiSourcePersistenceServices as $multiSourcePersistenceService) {
         $multiSourcePersistenceService->flushSaveQueue();
     }
     $sources = array();
     foreach ($this->_multiSourcePersistenceBackends as $multiSourcePersistenceBackend) {
         $sources[] = $multiSourcePersistenceBackend->getPersistenceQueue();
     }
     $sources = json_encode($sources);
     $this->_persistence->queueForSave(tubepress_api_options_Names::SOURCES, $sources);
     $this->_persistence->flushSaveQueue();
 }