/** * Test extractPosts method. * * @param int $postsNumber * @param array $expected * * @dataProvider getProvider */ public function testExtractPosts($postsNumber, array $expected) { $result = $this->invokeMethod($this->twitterProvider, 'extractPosts', array($this->fixtures->getFixtureArray($postsNumber))); static::assertEquals($expected, $result); }
/** * @return array */ public function getProvider() { $object = new TwitterResponseFixtures(); return array(array('array' => $object->getFixtureArray(2), 'method' => 'text', 'expected' => $object->getFixtureExpectedArray(2)), array('array' => $object->getFixtureItemWithErrorArray(), 'method' => 'message', 'expected' => $object->getFixtureExpectedItemWithErrorArray())); }
/** * @param $tweetsNumber */ protected function setTweetsNumber($tweetsNumber) { $this->expectedValue = $this->fixtures->getFixtureArray($tweetsNumber); \Phake::when($this->twitterOauth)->get(\Phake::anyParameters())->thenReturn($this->expectedValue); }