Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93c43b0
commit 2caf913
Showing
6 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ node_modules/ | |
composer.lock | ||
package-lock.json | ||
.php_cs.cache | ||
var/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
declare(strict_types=1); | ||
namespace In2code\Lux\Exception; | ||
|
||
/** | ||
* Class FileNotFoundException | ||
*/ | ||
class FileNotFoundException extends \Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
if (empty($webRoot = getenv('TYPO3_PATH_WEB'))) { | ||
putenv('TYPO3_PATH_WEB=' . $webRoot = realpath(__DIR__ . '/../../.Build/Web') . '/'); | ||
} else { | ||
$webRoot = rtrim($webRoot, '/') . '/'; | ||
} | ||
$buildRoot = realpath($webRoot . '/..'); | ||
$autoload = $buildRoot . '/vendor/autoload.php'; | ||
if (!file_exists($autoload)) { | ||
throw new \In2code\Lux\Exception\FileNotFoundException('Can not find autoload path', 1626011935); | ||
} | ||
|
||
$bootstrapLoaded = false; | ||
$bootstrap = $webRoot . '/typo3/sysext/core/Build/UnitTestsBootstrap.php'; | ||
$bootstrapNimut = $buildRoot . '/vendor/nimut/testing-framework/res/Configuration/UnitTestsBootstrap.php'; | ||
if (file_exists($bootstrap)) { | ||
require($bootstrap); | ||
$bootstrapLoaded = true; | ||
} elseif (file_exists($bootstrapNimut)) { | ||
require($bootstrapNimut); | ||
$bootstrapLoaded = true; | ||
} | ||
if ($bootstrapLoaded === false) { | ||
throw new \In2code\Lux\Exception\FileNotFoundException( | ||
'Can not find unit test bootstrap file. Did you do a composer update?', | ||
1626011924 | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Unit tests in lux | ||
|
||
Before you start with testing, just do a `composer install` in the lux main folder to install all needed resources and | ||
testing frameworks. | ||
|
||
## Start in PhpStorm | ||
|
||
Just right click on file `phpunit.xml.dist` and select `run` | ||
|
||
## Start from CLI | ||
|
||
`.Build/vendor/phpunit/phpunit/phpunit` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters