for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Chillu\ElementalEmbedlyBlock\Tests\Block;
use Chillu\ElementalEmbedlyBlock\Block\EmbedlyBlock;
use SilverStripe\Dev\SapphireTest;
class EmbedlyBlockTest extends SapphireTest
{
public function testWidthAcceptsPercent()
$block = new EmbedlyBlock([
'Width' => '100%'
]);
$this->assertEquals('100%', $block->getWidthAttribute());
}
public function testWidthAcceptsPx()
'Width' => '100px'
$this->assertEquals('100px', $block->getWidthAttribute());
public function testWidthSanitisesInvalidValues()
'Width' => 'invalid'
$this->assertEquals('', $block->getWidthAttribute());