Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7dd9c68

Browse files
committed
Additional functional testing
1 parent 64d39a2 commit 7dd9c68

10 files changed

Lines changed: 57 additions & 0 deletions

File tree

src/Sylius/Bundle/ThemeBundle/Tests/DependencyInjection/FilesystemSource/ConfigurationTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,25 @@ public function it_uses_app_themes_filesystem_as_the_default_source(): void
4141
);
4242
}
4343

44+
/**
45+
* @test
46+
*/
47+
public function it_allows_an_integer_for_scan_depth(): void
48+
{
49+
$this->assertProcessedConfigurationEquals(
50+
[
51+
['scan_depth' => 1, 'sources' => ['filesystem' => null]],
52+
],
53+
['sources' => ['filesystem' => [
54+
'directories' => ['%kernel.root_dir%/themes'],
55+
'filename' => 'composer.json',
56+
'enabled' => true,
57+
'scan_depth' => 1,
58+
]]],
59+
'sources'
60+
);
61+
}
62+
4463
/**
4564
* @test
4665
*/
@@ -93,6 +112,19 @@ public function it_is_invalid_to_pass_a_string_as_theme_directories(): void
93112
);
94113
}
95114

115+
/**
116+
* @test
117+
*/
118+
public function it_is_invalid_to_pass_a_string_as_scan_depth(): void
119+
{
120+
$this->assertPartialConfigurationIsInvalid(
121+
[
122+
['scan_depth' => 'test'],
123+
],
124+
'sources.filesystem'
125+
);
126+
}
127+
96128
/**
97129
* @test
98130
*/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This should not be overridden by first theme
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
test:
2+
theme_bundle: 'That should not be overridden by first test theme.'
3+
theme: 'That should not be overridden by first test theme.'
4+
parent_theme_bundle: 'PARENT_THEME/BUNDLE_NAME/translations'
5+
parent_theme: 'PARENT_THEME/BUNDLE_NAME/translations'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TestBundle:Templating:bothThemesTemplate.txt.twig|sylius/third-test-theme
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TestBundle:Templating:lastThemeTemplate.txt.twig|sylius/third-test-theme
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "sylius/third-test-theme",
3+
"extra": {
4+
"sylius-theme": {
5+
"title": "Sylius Third Theme",
6+
"parents": [
7+
"sylius/first-test-theme"
8+
]
9+
}
10+
}
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test:
2+
theme: 'That should not be overridden by first test theme.'
3+
parent_theme: 'PARENT_THEME/translations'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:Templating:bothThemesTemplate.txt.twig|sylius/third-test-theme
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:Templating:lastThemeTemplate.txt.twig|sylius/third-test-theme

src/Sylius/Bundle/ThemeBundle/Tests/Functional/app/config/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ twig:
2525
sylius_theme:
2626
sources:
2727
filesystem:
28+
scan_depth: 1
2829
directories:
2930
- "%kernel.root_dir%/../../Fixtures/themes"

0 commit comments

Comments
 (0)