/** * Test... * * @covers JLanguage::setIgnoredSearchWordsCallback * @covers JLanguage::getIgnoredSearchWordsCallback * * @return void */ public function testSetIgnoredSearchWordsCallback() { $function1 = 'phpinfo'; $function2 = 'print'; $lang = new JLanguage(''); $this->assertTrue(is_callable($lang->getIgnoredSearchWordsCallback())); // Note: set -> $funtion1: set returns NULL and get returns $function1 $this->assertTrue(is_callable($lang->setIgnoredSearchWordsCallback($function1))); $get = $lang->getIgnoredSearchWordsCallback(); $this->assertEquals($function1, $get, 'Line: ' . __LINE__); $this->assertNotEquals($function2, $get, 'Line: ' . __LINE__); // Note: set -> $function2: set returns $function1 and get retuns $function2 $set = $lang->setIgnoredSearchWordsCallback($function2); $this->assertEquals($function1, $set, 'Line: ' . __LINE__); $this->assertNotEquals($function2, $set, 'Line: ' . __LINE__); $this->assertEquals($function2, $lang->getIgnoredSearchWordsCallback(), 'Line: ' . __LINE__); $this->assertNotEquals($function1, $lang->getIgnoredSearchWordsCallback(), 'Line: ' . __LINE__); }