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