public static function setUpBeforeClass() { if (file_exists(__DIR__ . "/../.env")) { $dotenv = new Dotenv\Dotenv(__DIR__ . "/../"); $dotenv->load(); } self::$instagram = new \marvinosswald\Instagram\Instagram(['accessToken' => getenv('INSTAGRAM_ACCESS_TOKEN')]); }
public function testCreateMedia() { $r = self::$api->makeRequest('POST', '/v1/media', array(), array('title' => $this->testTitle, 'description' => $this->testDescription, 'tags' => $this->testTags, 'is_published' => $this->isPublished, 'is_marketplace' => $this->isMarketplace)); $this->assertArrayHasKey('success', $r); $this->assertEquals(true, $r['success']); $this->assertArrayHasKey('obj', $r); $obj = $r['obj']; $this->assertMediaObjectArrayCorrect($obj); $this->assertTestDataMatches($obj); self::$createdMediaId = $obj['id']; }
public function getPostMock() { $author = new AuthorTest(); $media = new MediaTest(); return array('ID' => '1', 'title' => 'Test title', 'status' => 'Test status', 'type' => 'test', 'author' => $author->getAuthorMock(), 'date' => time(), 'date_gmt' => time(), 'modified' => time(), 'modified_gmt' => time(), 'modified_tz' => time(), 'slug' => 'test', 'content' => 'content', 'excerpt' => 'excerpt', 'parent' => 1, 'link' => 'http://test.domain.com', 'guid' => 2, 'menu_order' => 'excerpt', 'comment_status' => 'comment_status', 'ping_status' => 'ping_status', 'sticky' => 'sticky', 'format' => 'format', 'terms' => 'terms', 'meta' => 'meta', 'post_thumbnail' => $media->getMediaMock()); }