コード例 #1
0
 public function testCountFirstPersonReferences()
 {
     $count = AllAboutYouInsight::countFirstPersonReferences("I don't know, really? I thought so.");
     $this->assertEqual($count, 2);
     $count = AllAboutYouInsight::countFirstPersonReferences("Now that I'm back on Android, realizing just how under sung Google Now is. I want it everywhere.");
     $this->assertEqual($count, 2);
     $count = AllAboutYouInsight::countFirstPersonReferences("New YearÕs Eve! Feeling very gay today, but not very homosexual.");
     $this->assertEqual($count, 0);
     $count = AllAboutYouInsight::countFirstPersonReferences("Tis the season for adorable cards w/ photos of my " . "friends' kids & pets that remind me what I'd do for the holidays if I had my act together.");
     $this->assertEqual($count, 5);
     $count = AllAboutYouInsight::countFirstPersonReferences("Took 1 firearms safety class to realize my " . "fantasy of stopping an attacker was just that: http://bit.ly/mybH2j  Slate: http://slate.me/T6vwde");
     $this->assertEqual($count, 1);
     $count = AllAboutYouInsight::countFirstPersonReferences("When @anildash told me he was writing this I was " . "like 'yah whatever cool' then I read it and it knocked my socks off http://bit.ly/W9ASnj ");
     $this->assertEqual($count, 4);
 }