コード例 #1
0
 /**
  * Method to test adding an instruction, retrieving the instructions array, and removing it
  *
  * @return  void
  *
  * @since   3.1
  */
 public function testManipulateInstructions()
 {
     // Add our test instruction
     $this->object->addInstruction(FinderIndexer::MISC_CONTEXT, 'testItem');
     $instructions = $this->object->getInstructions();
     $testItem = $instructions[FinderIndexer::MISC_CONTEXT];
     // Assert the test instruction is present
     $this->assertContains('testItem', $testItem);
     // Remove the test instruction
     $this->object->removeInstruction(FinderIndexer::MISC_CONTEXT, 'testItem');
     $instructions = $this->object->getInstructions();
     $testItem = $instructions[FinderIndexer::MISC_CONTEXT];
     // Assert the test instruction is gone
     $this->assertNotContains('testItem', $testItem);
 }