From 2387082e883bf10a0ee628798db9ccdf8e08e72b Mon Sep 17 00:00:00 2001 From: jedi Date: Sat, 18 Jan 2020 00:39:45 +0100 Subject: [PATCH] create first tests --- .gitignore | 2 ++ public/thumbnail.php | 4 +++- tests/ApiTest.php | 43 +++++++++++++++++++++++++++++++++++++++++++ tests/ExampleTest.php | 21 --------------------- tests/TestCase.php | 4 ++++ 5 files changed, 52 insertions(+), 22 deletions(-) create mode 100644 tests/ApiTest.php delete mode 100644 tests/ExampleTest.php diff --git a/.gitignore b/.gitignore index e7a5ad8..159c028 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ Homestead.yaml composer.lock composer.phar + +.phpunit.result.cache diff --git a/public/thumbnail.php b/public/thumbnail.php index e50bd2e..a6339a4 100644 --- a/public/thumbnail.php +++ b/public/thumbnail.php @@ -1,7 +1,9 @@ get('/'); + $this->assertEquals( + $this->app->version(), $this->response->getOriginalContent()['framework_version'] + ); + } + + public function testEvents() + { + $this->get('/1/events'); + $this->assertResponseOk(); + $this->assertEquals('[]',$this->response->getContent()); + } + + public function testContainers() + { + $this->get('/1/boxes'); + $this->assertResponseOk(); + $this->assertEquals('[]',$this->response->getContent()); + } + + public function testFiles() + { + $this->get( '/1/files'); + $this->assertResponseOk(); + $this->assertEquals('[]',$this->response->getContent()); + } + + public function testItems() + { + Event::create(['slug'=>'TEST1','name'=>'Test Event 1']); + $this->get('/1/TEST1/items'); + $this->assertResponseOk(); + $this->assertEquals('[]',$this->response->getContent()); + } + +} diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php deleted file mode 100644 index 1bad6ef..0000000 --- a/tests/ExampleTest.php +++ /dev/null @@ -1,21 +0,0 @@ -get('/'); - - $this->assertEquals( - $this->app->version(), $this->response->getContent() - ); - } -} diff --git a/tests/TestCase.php b/tests/TestCase.php index 89a058d..b96aac8 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,7 +1,11 @@