|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace TractorCow\Fluent\Tests\Extension; |
|
4
|
|
|
|
|
5
|
|
|
use Page; |
|
|
|
|
|
|
6
|
|
|
use SilverStripe\CMS\Model\SiteTree; |
|
7
|
|
|
use SilverStripe\Control\Director; |
|
8
|
|
|
use SilverStripe\Dev\FunctionalTest; |
|
9
|
|
|
use TractorCow\Fluent\Extension\FluentDirectorExtension; |
|
10
|
|
|
use TractorCow\Fluent\Extension\FluentFilteredExtension; |
|
11
|
|
|
use TractorCow\Fluent\Extension\FluentSiteTreeExtension; |
|
12
|
|
|
use TractorCow\Fluent\State\FluentState; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* Class FluentDirectorExtensionTest |
|
16
|
|
|
* |
|
17
|
|
|
* @package TractorCow\Fluent\Tests\Extension |
|
18
|
|
|
*/ |
|
19
|
|
|
class FluentDirectorExtensionTest extends FunctionalTest |
|
20
|
|
|
{ |
|
21
|
|
|
/** |
|
22
|
|
|
* @var string |
|
23
|
|
|
*/ |
|
24
|
|
|
protected static $fixture_file = 'FluentDirectorExtensionTest.yml'; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* @var array |
|
28
|
|
|
*/ |
|
29
|
|
|
protected static $required_extensions = [ |
|
30
|
|
|
SiteTree::class => [ |
|
31
|
|
|
FluentSiteTreeExtension::class, |
|
32
|
|
|
FluentFilteredExtension::class, |
|
33
|
|
|
], |
|
34
|
|
|
Director::class => [ |
|
35
|
|
|
FluentDirectorExtension::class, |
|
36
|
|
|
], |
|
37
|
|
|
]; |
|
38
|
|
|
|
|
39
|
|
|
public function setUp() // phpcs:ignore SlevomatCodingStandard.TypeHints |
|
40
|
|
|
{ |
|
41
|
|
|
parent::setUp(); |
|
42
|
|
|
|
|
43
|
|
|
$this->logInWithPermission('ADMIN'); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function testVisitUrlByLocaleWithMultiByteCharacter() |
|
47
|
|
|
{ |
|
48
|
|
|
$locale = 'en_NZ'; |
|
49
|
|
|
FluentState::singleton()->withState(function (FluentState $state) use ($locale) { |
|
50
|
|
|
$state->setLocale($locale); |
|
51
|
|
|
|
|
52
|
|
|
$expectedTitle = sprintf('Page1 (%s)', $locale); |
|
53
|
|
|
|
|
54
|
|
|
/** @var Page|FluentSiteTreeExtension $page */ |
|
55
|
|
|
$page = Page::get()->filter(['Title' => $expectedTitle])->first(); |
|
56
|
|
|
$this->assertNotEmpty($page); |
|
57
|
|
|
$page->publishRecursive(); |
|
|
|
|
|
|
58
|
|
|
|
|
59
|
|
|
$this->get($page->AbsoluteLink()); |
|
|
|
|
|
|
60
|
|
|
|
|
61
|
|
|
$this->assertContains(sprintf('<title>%s', $expectedTitle), $this->content()); |
|
62
|
|
|
}); |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths