public function testImportPostFromDateNow() { Assert::has($GLOBALS, ['INSTAGRAM_IMPORT_POSTS_FROM', 'INSTAGRAM_NUMBER_OF_POSTS']); $api = new \Brs\SocialMediaAPI\API\Instagram(['clientOptions' => Helper::getInstagramClientOptions()]); $counter = 0; $api->importPosts(function ($post) use(&$counter) { $counter++; return md5(microtime()); }, ['fromDate' => $GLOBALS['INSTAGRAM_IMPORT_POSTS_FROM']]); $this->assertEquals($GLOBALS['INSTAGRAM_NUMBER_OF_POSTS'], $counter); $counter2 = 0; $api->importPosts(function ($post) use(&$counter2) { $counter2++; return md5(microtime()); }); $this->assertEquals(0, $counter2); }