FIX Update BlogFunctionalTest for SS4

This commit is contained in:
Robbie Averill 2017-09-14 17:16:05 +12:00
parent 7f63681d33
commit db18b5d31f
4 changed files with 22 additions and 14 deletions

View File

@ -23,11 +23,10 @@ before_script:
# Install composer dependencies
- composer install --prefer-dist
- composer require --prefer-dist --no-update symfony/config:^3.2 silverstripe/framework:4.0.x-dev silverstripe/cms:4.0.x-dev silverstripe/admin:1.0.x-dev silverstripe/assets:1.0.x-dev silverstripe/versioned:1.0.x-dev
- composer require --prefer-dist --no-update silverstripe/installer:4.0.x-dev
- if [[ $DB == PGSQL ]]; then composer require --prefer-dist --no-update silverstripe/postgresql:2.0.x-dev; fi
- composer update
- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.0.x-dev --prefer-dist; fi
script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests/; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml tests/; fi

View File

@ -2,6 +2,7 @@
namespace SilverStripe\Blog\Forms\GridField;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Lumberjack\Forms\GridFieldConfig_Lumberjack;
use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeState;
@ -19,6 +20,6 @@ class GridFieldConfig_BlogPost extends GridFieldConfig_Lumberjack
parent::__construct($itemsPerPage);
$this->removeComponentsByType(GridFieldSiteTreeState::class);
$this->addComponent(GridFieldBlogPostState::create());
$this->addComponent(Injector::inst()->create(GridFieldBlogPostState::class));
}
}

View File

@ -1,18 +1,24 @@
<?php
namespace SilverStripe\Blog\Tests;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\FunctionalTest;
use SilverStripe\i18n\i18n;
use SilverStripe\View\Parsers\URLSegmentFilter;
class BlogFunctionalTest extends FunctionalTest
{
protected static $fixture_file = 'BlogFunctionalTest.yml';
protected static $use_draft_site = true;
public function setUp()
protected function setUp()
{
Config::inst()->update('URLSegmentFilter', 'default_allow_multibyte', true);
Config::modify()->set(URLSegmentFilter::class, 'default_allow_multibyte', true);
i18n::set_locale('fa_IR');
parent::setUp();
i18n::set_locale('fa_IR');
}
public function testBlogWithMultibyteUrl()

View File

@ -1,4 +1,4 @@
Member:
SilverStripe\Security\Member:
member_a:
FirstName: عبّاس
Surname: آبان
@ -8,15 +8,17 @@ Member:
Surname: Jones
Email: bobjones@example.com
Blog:
SilverStripe\Blog\Model\Blog:
blog_a:
URLSegment: آبید
Title: My Blog
BlogPost:
SilverStripe\Blog\Model\BlogPost:
blogpost_a:
Title: My Blog Post
URLSegment: آبیدآبید
PublishDate: '2017-08-01 00:00:00'
Parent: =>Blog.blog_a
Authors: =>Member.member_a, =>Member.member_b
PublishDate: 2017-08-01 00:00:00
Parent: =>SilverStripe\Blog\Model\Blog.blog_a
Authors:
- =>SilverStripe\Security\Member.member_a
- =>SilverStripe\Security\Member.member_b