mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Merge pull request #500 from dhensby/pulls/test-fixes
Fix regression in tests
This commit is contained in:
commit
649536521d
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Blog\Widgets;
|
namespace SilverStripe\Blog\Widgets;
|
||||||
|
|
||||||
if (!class_exists('\\SilverStripe\\Widgets\\Model\\Widget')) {
|
use SilverStripe\Widgets\Model\WidgetController;
|
||||||
|
|
||||||
|
if (!class_exists(WidgetController::class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
use SilverStripe\Widgets\Model\WidgetController;
|
|
||||||
|
|
||||||
class BlogArchiveWidgetController extends WidgetController
|
class BlogArchiveWidgetController extends WidgetController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Blog\Widgets;
|
namespace SilverStripe\Blog\Widgets;
|
||||||
|
|
||||||
if (!class_exists('\\SilverStripe\\Widgets\\Model\\Widget')) {
|
use SilverStripe\Widgets\Model\WidgetController;
|
||||||
|
|
||||||
|
if (!class_exists(WidgetController::class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
use SilverStripe\Widgets\Model\WidgetController;
|
|
||||||
|
|
||||||
class BlogCategoriesWidgetController extends WidgetController
|
class BlogCategoriesWidgetController extends WidgetController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Blog\Widgets;
|
namespace SilverStripe\Blog\Widgets;
|
||||||
|
|
||||||
if (!class_exists('\\SilverStripe\\Widgets\\Model\\Widget')) {
|
use SilverStripe\Widgets\Model\WidgetController;
|
||||||
|
|
||||||
|
if (!class_exists(WidgetController::class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
use SilverStripe\Widgets\Model\WidgetController;
|
|
||||||
|
|
||||||
class BlogRecentPostsWidgetController extends WidgetController
|
class BlogRecentPostsWidgetController extends WidgetController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Blog\Widgets;
|
namespace SilverStripe\Blog\Widgets;
|
||||||
|
|
||||||
if (!class_exists('\\SilverStripe\\Widgets\\Model\\Widget')) {
|
use SilverStripe\Widgets\Model\WidgetController;
|
||||||
|
|
||||||
|
if (!class_exists(WidgetController::class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
use SilverStripe\Widgets\Model\WidgetController;
|
|
||||||
|
|
||||||
class BlogTagsCloudWidgetController extends WidgetController
|
class BlogTagsCloudWidgetController extends WidgetController
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace SilverStripe\Blog\Widgets;
|
namespace SilverStripe\Blog\Widgets;
|
||||||
|
|
||||||
if (!class_exists('\\SilverStripe\\Widgets\\Model\\Widget')) {
|
use SilverStripe\Widgets\Model\WidgetController;
|
||||||
|
|
||||||
|
if (!class_exists(WidgetController::class)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
use SilverStripe\Widgets\Model\WidgetController;
|
|
||||||
|
|
||||||
class BlogTagsWidgetController extends WidgetController
|
class BlogTagsWidgetController extends WidgetController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class BlogArchiveWidgetTest extends SapphireTest
|
|||||||
|
|
||||||
$this->assertInstanceOf(SS_List::class, $archive);
|
$this->assertInstanceOf(SS_List::class, $archive);
|
||||||
$this->assertCount(3, $archive);
|
$this->assertCount(3, $archive);
|
||||||
$this->assertDOSContains([
|
$this->assertListContains([
|
||||||
['Title' => 'August 2017'],
|
['Title' => 'August 2017'],
|
||||||
['Title' => 'September 2017'],
|
['Title' => 'September 2017'],
|
||||||
['Title' => 'May 2015'],
|
['Title' => 'May 2015'],
|
||||||
@ -54,13 +54,14 @@ class BlogArchiveWidgetTest extends SapphireTest
|
|||||||
$original = Versioned::get_stage();
|
$original = Versioned::get_stage();
|
||||||
|
|
||||||
$this->objFromFixture(BlogPost::class, 'post-b')->publishRecursive();
|
$this->objFromFixture(BlogPost::class, 'post-b')->publishRecursive();
|
||||||
|
$this->objFromFixture(BlogArchiveWidget::class, 'archive-monthly')->publishRecursive();
|
||||||
Versioned::set_stage(Versioned::LIVE);
|
Versioned::set_stage(Versioned::LIVE);
|
||||||
|
|
||||||
$widget = $this->objFromFixture(BlogArchiveWidget::class, 'archive-monthly');
|
$widget = $this->objFromFixture(BlogArchiveWidget::class, 'archive-monthly');
|
||||||
$archive = $widget->getArchive();
|
$archive = $widget->getArchive();
|
||||||
|
|
||||||
$this->assertCount(1, $archive);
|
$this->assertCount(1, $archive);
|
||||||
$this->assertDOSContains([
|
$this->assertListContains([
|
||||||
['Title' => 'August 2017'],
|
['Title' => 'August 2017'],
|
||||||
], $archive);
|
], $archive);
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ class BlogArchiveWidgetTest extends SapphireTest
|
|||||||
|
|
||||||
$this->assertInstanceOf(SS_List::class, $archive);
|
$this->assertInstanceOf(SS_List::class, $archive);
|
||||||
$this->assertCount(2, $archive);
|
$this->assertCount(2, $archive);
|
||||||
$this->assertDOSContains([
|
$this->assertListContains([
|
||||||
['Title' => '2017'],
|
['Title' => '2017'],
|
||||||
['Title' => '2015'],
|
['Title' => '2015'],
|
||||||
], $archive);
|
], $archive);
|
||||||
|
Loading…
Reference in New Issue
Block a user