Skip to content

Commit

Permalink
PHP 7.2: Avoid undefined constants when running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed Aug 6, 2018
1 parent 3250549 commit 93ef8e3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Test/Server/Core/Uri/RouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ public function testDispatcherNotFoundPage(): void
$this->assertRequestMethods();

Phake::verify($this->view)->display('error.twig', [
'siteName' => 'SITE_NAME',
'siteName' => 'Lifyzer App',
'pageName' => 'Page Not Found',
'message' => 'The page doesn\'t exist',
'siteUrl' => 'SITE_URL'
'siteUrl' => 'https://lifyzer.com/app/'
]);
}

Expand Down
16 changes: 16 additions & 0 deletions Test/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @author Pierre-Henry Soria <hello@lifyzer.com>
* @copyright (c) 2018, Pierre-Henry Soria. All Rights Reserved.
* @license GNU General Public License; <https://www.gnu.org/licenses/gpl-3.0.en.html>
* @link https://lifyzer.com
*/

/**
* Avoid undefined constants when running tests.
*/
define('SITE_URL', 'https://lifyzer.com/app/');
define('SITE_NAME', 'Lifyzer App');
define('DEBUG_MODE', true);

require dirname(__DIR__) . '/Server/vendor/autoload.php';
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit
bootstrap="Server/vendor/autoload.php"
bootstrap="Test/bootstrap.php"
verbose="true"
colors="true">
<testsuites>
<testsuite name="Lifyzer Webapp CMS">
<directory>test</directory>
<directory>Test</directory>
</testsuite>
</testsuites>

Expand Down

0 comments on commit 93ef8e3

Please sign in to comment.