for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SilverStripe\StaticPublishQueue\Test;
use Psr\Log\LoggerInterface;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\StaticPublishQueue\Test\SiteTreePublishingEngineTest\Model\StaticPublishingTriggerPage;
class SiteTreePublishingEngineTest extends SapphireTest
{
protected function setUp()
parent::setUp();
Injector::inst()->registerService(@$this->createMock(LoggerInterface::class), LoggerInterface::class);
}
public function testCollectChangesForPublishing()
$obj = StaticPublishingTriggerPage::create();
$obj->collectChanges(['action' => 'publish']);
$this->assertSame(
'/updateOnPublish',
$obj->getToUpdate()->first()->url
);
'/deleteOnPublish',
$obj->getToDelete()->first()->url
public function testCollectChangesForUnpublishing()
$obj->collectChanges(['action' => 'unpublish']);
'/updateOnUnpublish',
'/deleteOnUnpublish',