diff options
| author | Kevin J Hoerr <kjhoerr@submelon.tech> | 2018-08-26 01:38:28 -0400 |
|---|---|---|
| committer | Kevin Hoerr <kjhoerr@submelon.tech> | 2018-08-31 23:24:45 -0400 |
| commit | 0965d62be00a7820f97284704dc71f37e661b412 (patch) | |
| tree | 5a5c9d69062e24aa926eb30447c5ff27e0a65492 /test/Controller/ControllerTest.php | |
| parent | 1e3946f04b5b602d3869a285d897acb0ba2b3c35 (diff) | |
| download | august-offensive-0965d62be00a7820f97284704dc71f37e661b412.tar.gz august-offensive-0965d62be00a7820f97284704dc71f37e661b412.tar.bz2 august-offensive-0965d62be00a7820f97284704dc71f37e661b412.zip | |
Begin migration to Rust; Add actix-web, diesel as main dependencies
Diffstat (limited to 'test/Controller/ControllerTest.php')
| -rw-r--r-- | test/Controller/ControllerTest.php | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/test/Controller/ControllerTest.php b/test/Controller/ControllerTest.php deleted file mode 100644 index 6931bc1..0000000 --- a/test/Controller/ControllerTest.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace AugustOffensive\Controller; - -use PHPUnit\Framework\TestCase; -use AugustOffensive\Model; - -/** - * Integration test: requires DB connection. Expect side effects (use test db if possible). - * - * @covers Controller - */ -final class ControllerTest extends \PHPUnit\Framework\TestCase -{ - public function testDBConnection() - { - /* Disable integration test, for now - try { - $this->assertInstanceOf( - Model\Connection::class, - Controller::initiateConnection() - ); - } catch (\PDOException $err) { - $this->fail("Database not initialized correctly: " . $err->getMessage()); - }*/ - } - - public function testCreateQuery() - { - $path = array("api", "create", "query"); - $request = "DELETE"; - $content = array("c" => "cherry", "d" => "dike"); - $query = Controller::createQuery($path, $request, $content); - - $this->assertInstanceOf( - Model\Query::class, - $query - ); - - $this->assertEquals( - $path, - $query->getPath() - ); - $this->assertEquals( - $request, - $query->getRequest() - ); - $this->assertEquals( - $content, - $query->getContent() - ); - } - - public function testCreateResult() - { - - $resultType = "TYPE"; - $result = array("no", "values"); - $resultObject = Controller::createResult($resultType, $result); - - $this->assertInstanceOf( - Model\Result::class, - $resultObject - ); - - $this->assertEquals( - $resultType, - $resultObject->getResultType() - ); - $this->assertEquals( - $result, - $resultObject->getResult() - ); - } - - public function testErrorResult() - { - $message = "Oh no! Oops!"; - $errorResult = Controller::errorResult(new \Exception($message)); - - $this->assertInstanceOf( - Model\Result::class, - $errorResult - ); - - $this->assertEquals( - "ERROR", - $errorResult->getResultType() - ); - $this->assertEquals( - array("error" => $message), - $errorResult->getResult() - ); - } -} |
