public function testFunctionIdentification()
 {
     try {
         throw new NotImplementedException();
     } catch (NotImplementedException $e) {
         $this->assertTrue(StringUtils::search($e->getMessage(), get_called_class() . '->testFunctionIdentification()'));
     }
 }
 public function testHideCaller()
 {
     try {
         throw new InvalidArgumentException('string', new \stdClass(), 1, true);
     } catch (InvalidArgumentException $e) {
         $this->assertFalse(StringUtils::search($e->getMessage(), get_called_class() . '->testHideCaller()'));
     }
 }
Пример #3
0
 public function testSearch()
 {
     $this->assertTrue(StringUtils::search('lorem ipsum dolor sit amet', 'sit'));
     $this->assertTrue(StringUtils::search('lorem ipsum dolor sit amet', array('undefined', 'ipsum')));
     $this->assertTrue(StringUtils::search('LOREM ipsum DOLOR sit amet', array('undefined', 'ipsum')));
     $this->assertFalse(StringUtils::search('lorem ipsum dolor sit amet', 'what'));
     $this->assertFalse(StringUtils::search('', array()));
     $this->assertFalse(StringUtils::search('lorem ipsum dolor sit amet', array('what', 'happened', 'to', 'us')));
 }