parent
0ad57c277f
commit
804ddb76d4
@ -0,0 +1,14 @@ |
|||||||
|
<?php |
||||||
|
// SPDX-License-Identifier: EUPL-1.2 |
||||||
|
// Authors: see README.md |
||||||
|
|
||||||
|
namespace SeaCMS\App; |
||||||
|
|
||||||
|
use Exception; |
||||||
|
use SeaCMS\App\TestException; |
||||||
|
|
||||||
|
/** |
||||||
|
* define exception to caught return for tests |
||||||
|
*/ |
||||||
|
class TestException extends Exception |
||||||
|
{} |
@ -0,0 +1,22 @@ |
|||||||
|
<?php |
||||||
|
// SPDX-License-Identifier: EUPL-1.2 |
||||||
|
// Authors: see README.md |
||||||
|
|
||||||
|
namespace SeaCMS\App; |
||||||
|
|
||||||
|
use SeacmsAppPlugin; |
||||||
|
use SeaCMS\App\TestException; |
||||||
|
|
||||||
|
/** |
||||||
|
* define interface for tests |
||||||
|
*/ |
||||||
|
interface TestInterface |
||||||
|
{ |
||||||
|
/** |
||||||
|
* run tests |
||||||
|
* @param SeacmsAppPlugin $plugin |
||||||
|
* @param string $output |
||||||
|
* @throws TestException |
||||||
|
*/ |
||||||
|
public function run(SeacmsAppPlugin $plugin, string $output); |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
/** |
||||||
|
* SPDX-License-Identifier: EUPL-1.2 |
||||||
|
* Authors: see /README.md |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace SeaCMS\App\Test; |
||||||
|
|
||||||
|
use SeaCMS\App; |
||||||
|
use PHPUnit\Framework\TestCase; |
||||||
|
|
||||||
|
final class AppTest extends TestCase { |
||||||
|
|
||||||
|
public function testSuccess(): void |
||||||
|
{ |
||||||
|
$app = new App(''); |
||||||
|
$output = $app->runPico(); |
||||||
|
$this->assertTrue($app instanceof App); |
||||||
|
} |
||||||
|
public function testFailure(): void |
||||||
|
{ |
||||||
|
$this->assertTrue(false); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue