getWatched() 공개 메소드

Find a function matching a watched function.
public getWatched ( string $pattern ) : null | array
$pattern string The pattern to look for.
리턴 null | array An list of matching functions or null.
예제 #1
0
 public function testGetWatched()
 {
     $fixture = $this->_fixture[0];
     $profile = new Xhgui_Profile($fixture);
     $data = $profile->getProfile();
     $this->assertEmpty($profile->getWatched('not there'));
     $matches = $profile->getWatched('strpos.*');
     $this->assertCount(1, $matches);
     $this->assertEquals('strpos()', $matches[0]['function']);
     $this->assertEquals($data['strpos()']['wt'], $matches[0]['wt']);
     $matches = $profile->getWatched('str.*');
     $this->assertCount(1, $matches);
     $this->assertEquals('strpos()', $matches[0]['function']);
     $this->assertEquals($data['strpos()']['wt'], $matches[0]['wt']);
     $matches = $profile->getWatched('[ms].*');
     $this->assertCount(2, $matches);
     $this->assertEquals('strpos()', $matches[0]['function']);
     $this->assertEquals($data['strpos()']['wt'], $matches[0]['wt']);
     $this->assertEquals('main()', $matches[1]['function']);
     $this->assertEquals($data['main()']['wt'], $matches[1]['wt']);
 }