mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX Update BlogFunctionalTest for SS4
This commit is contained in:
parent
7f63681d33
commit
db18b5d31f
@ -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
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user