parent
774b367460
commit
79242846b3
@ -1,5 +1,7 @@ |
|||||||
/src/logs/ |
/src/logs/ |
||||||
tts_framework/ |
tts_framework/ |
||||||
|
vendor/ |
||||||
/src/tmp/ |
/src/tmp/ |
||||||
/public/assets/mockup/js/tts.min.js |
/public/assets/mockup/js/tts.min.js |
||||||
/public/assets/mockup/js/tts.min.map |
/public/assets/mockup/js/tts.min.map |
||||||
|
.phpunit.result.cache |
||||||
|
|||||||
@ -0,0 +1,32 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
declare(strict_types=1); |
||||||
|
|
||||||
|
namespace UnitTestFiles\Test; |
||||||
|
use PHPUnit\Framework\TestCase; |
||||||
|
|
||||||
|
class FirstTest extends TestCase { |
||||||
|
|
||||||
|
public function setUp(): void { |
||||||
|
require "setup.php"; |
||||||
|
setup("/mockup/app/first/returns_true.html"); |
||||||
|
} |
||||||
|
|
||||||
|
private function do_routes() { |
||||||
|
$found_route = \tts\router::execute(); |
||||||
|
|
||||||
|
if ($found_route) { |
||||||
|
$condition = $found_route; |
||||||
|
} else { |
||||||
|
$app = new \tts\app(); |
||||||
|
$condition = $app->load_controller(); |
||||||
|
} |
||||||
|
return $condition; |
||||||
|
} |
||||||
|
|
||||||
|
public function testTrueAssetsToTrue() { |
||||||
|
$condition = $this->do_routes(); |
||||||
|
$this->assertTrue($condition); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
<?php |
||||||
|
function setup(string $route) { |
||||||
|
$p_dir = dirname(__DIR__, 2) . "/src/"; |
||||||
|
require_once $p_dir . 'before_main.php'; |
||||||
|
|
||||||
|
\tts\site_helper::set_all_projects(['mockup', 'ex', 'live']); |
||||||
|
\tts\site_helper::set_default_project("mockup"); |
||||||
|
|
||||||
|
$PHPUNIT_Testing = true; |
||||||
|
\tts\site_helper::init(PROJECT_BASE_DIR, $route, "get", $PHPUNIT_Testing); |
||||||
|
|
||||||
|
require_once PROJECT_BASE_DIR . 'main.php'; |
||||||
|
} |
||||||
@ -1,4 +1,4 @@ |
|||||||
#!/usr/bin/php |
#!/usr/bin/env php |
||||||
<?php |
<?php |
||||||
|
|
||||||
declare(strict_types=1); |
declare(strict_types=1); |
||||||
@ -0,0 +1,5 @@ |
|||||||
|
{ |
||||||
|
"require-dev": { |
||||||
|
"phpunit/phpunit": "^9.5" |
||||||
|
} |
||||||
|
} |
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,8 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<phpunit bootstrap="vendor/autoload.php" colors="true"> |
||||||
|
<testsuites> |
||||||
|
<testsuite name="Application Test Suite"> |
||||||
|
<directory>UnitTestFiles/Test/</directory> |
||||||
|
</testsuite> |
||||||
|
</testsuites> |
||||||
|
</phpunit> |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
namespace prj\mockup\test_controllers\app; |
||||||
|
|
||||||
|
final class first_ctrl { |
||||||
|
|
||||||
|
public function returns_true(): bool { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue