Skip to content

Commit

Permalink
Fix the functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jan 6, 2019
1 parent a2c6aa4 commit 5983d04
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion calendar-bundle/src/Resources/contao/config/config.php
Expand Up @@ -35,7 +35,7 @@
$GLOBALS['TL_CRON']['daily']['generateCalendarFeeds'] = array('Calendar', 'generateFeeds');

// Style sheet
if (TL_MODE == 'BE')
if (defined('TL_MODE') && TL_MODE == 'BE')
{
$GLOBALS['TL_CSS'][] = 'bundles/contaocalendar/calendar.min.css|static';
}
Expand Down
33 changes: 17 additions & 16 deletions core-bundle/tests/Contao/RoutingTest.php
Expand Up @@ -47,7 +47,7 @@ public function setUp(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsThePageIdFromTheUrl(): void
{
Expand Down Expand Up @@ -77,7 +77,7 @@ public function testReturnsThePageIdFromTheUrl(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsNullIfTheRequestIsEmpty(): void
{
Expand All @@ -93,7 +93,7 @@ public function testReturnsNullIfTheRequestIsEmpty(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsFalseIfTheRequestContainsAutoItem(): void
{
Expand Down Expand Up @@ -123,7 +123,7 @@ public function testReturnsFalseIfTheRequestContainsAutoItem(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsFalseIfTheUrlSuffixDoesNotMatch(): void
{
Expand Down Expand Up @@ -153,7 +153,7 @@ public function testReturnsFalseIfTheUrlSuffixDoesNotMatch(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsFalseUponDuplicateParameters(): void
{
Expand Down Expand Up @@ -183,7 +183,7 @@ public function testReturnsFalseUponDuplicateParameters(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsFalseIfTheRequestContainsAnAutoItemKeyword(): void
{
Expand Down Expand Up @@ -214,7 +214,7 @@ public function testReturnsFalseIfTheRequestContainsAnAutoItemKeyword(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testDecodesTheRequestString(): void
{
Expand Down Expand Up @@ -244,7 +244,7 @@ public function testDecodesTheRequestString(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testUnsetsEmptyFragments(): void
{
Expand Down Expand Up @@ -278,7 +278,8 @@ public function testUnsetsEmptyFragments(): void
*
* @runInSeparateProcess
* @preserveGlobalState disabled
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
*
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testAddsTheAutoItemFragment(): void
{
Expand Down Expand Up @@ -311,7 +312,7 @@ public function testAddsTheAutoItemFragment(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsNullIfOnlyTheLanguageIsGiven(): void
{
Expand Down Expand Up @@ -342,7 +343,7 @@ public function testReturnsNullIfOnlyTheLanguageIsGiven(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsFalseIfTheLanguageIsNotProvided(): void
{
Expand Down Expand Up @@ -373,7 +374,7 @@ public function testReturnsFalseIfTheLanguageIsNotProvided(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsFalseIfTheAliasIsEmpty(): void
{
Expand Down Expand Up @@ -405,7 +406,7 @@ public function testReturnsFalseIfTheAliasIsEmpty(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsFalseIfThereAreNoFragments(): void
{
Expand Down Expand Up @@ -441,7 +442,7 @@ public function testReturnsFalseIfThereAreNoFragments(): void
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testHandlesFolderUrlsWithoutLanguage(): void
{
Expand Down Expand Up @@ -502,7 +503,7 @@ function (array $options) {
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testHandlesFolderUrlsWithLanguage(): void
{
Expand Down Expand Up @@ -573,7 +574,7 @@ function (array $options) {
}

/**
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated and will no longer work in Contao 5.0. Use the Symfony routing instead.
* @expectedDeprecation Using Frontend::getPageIdFromUrl() has been deprecated %s.
*/
public function testReturnsFalseIfThereAreNoAliases(): void
{
Expand Down
Expand Up @@ -856,7 +856,7 @@ public function testRegistersTheContaoFramework(): void

$this->assertSame(ContaoFramework::class, $definition->getClass());
$this->assertTrue($definition->isPublic());
$this->assertSame(null, $definition->getArgument(0));
$this->assertNull($definition->getArgument(0));
$this->assertSame('router', (string) $definition->getArgument(1));
$this->assertSame('contao.routing.scope_matcher', (string) $definition->getArgument(2));
$this->assertSame('%kernel.project_dir%', (string) $definition->getArgument(3));
Expand Down
2 changes: 2 additions & 0 deletions core-bundle/tests/Functional/RoutingTest.php
Expand Up @@ -46,6 +46,8 @@ protected function setUp(): void
Input::resetUnusedGet();
Environment::reset();
InsertTags::reset();

Config::set('debugMode', false);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion faq-bundle/src/Resources/contao/config/config.php
Expand Up @@ -29,7 +29,7 @@
));

// Style sheet
if (TL_MODE == 'BE')
if (defined('TL_MODE') && TL_MODE == 'BE')
{
$GLOBALS['TL_CSS'][] = 'bundles/contaofaq/faq.min.css|static';
}
Expand Down
2 changes: 1 addition & 1 deletion news-bundle/src/Resources/contao/config/config.php
Expand Up @@ -35,7 +35,7 @@
$GLOBALS['TL_CRON']['daily']['generateNewsFeeds'] = array('News', 'generateFeeds');

// Style sheet
if (TL_MODE == 'BE')
if (defined('TL_MODE') && TL_MODE == 'BE')
{
$GLOBALS['TL_CSS'][] = 'bundles/contaonews/news.min.css|static';
}
Expand Down

0 comments on commit 5983d04

Please sign in to comment.