for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace X3dgoo\InstagramScraper\Tests;
use SilverStripe\Dev\SapphireTest;
use X3dgoo\InstagramScraper\Model\InstagramPost;
class InstagramPostTest extends SapphireTest
{
protected $usesDatabase = true;
public function testCreateInstagramPost()
$instagramPost = InstagramPost::create();
$instagramPost->write();
$this->assertNotNull($instagramPost);
}
public function testGetCMSFields()
$instagramPost->ImageThumbnailURL = 'https://via.placeholder.com/300/000/000.png';
$fields = $instagramPost->getCMSFields();
$this->assertNotNull($fields);
$this->assertNotNull($fields->fieldByName('Root')->fieldByName('Main')->fieldByName('Show'));