diff --git a/tests/CreateWishTest.php b/tests/CreateWishTest.php new file mode 100644 index 00000000..6ad61265 --- /dev/null +++ b/tests/CreateWishTest.php @@ -0,0 +1,53 @@ +apiRequest( + 'http://wishthis.online.localhost/api/wishes', + 'POST', + array( + 'wish_title' => 'WD Red SA500 NAS SATA SSD 2TB 2.5": Amazon.de: Computer & Accessories', + 'wishlist_id' => $this->testWishlistId, + ) + ); + + $this->assertNotFalse($apiResponse); + + $json = \json_decode($apiResponse, true); + $this->assertNotNull($json); + $this->assertTrue($json['success']); + $this->assertEmpty($json['warning'], 'There has been unexpected output.'); + } +} diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..5d6114cf --- /dev/null +++ b/tests/README.md @@ -0,0 +1,5 @@ +# Tests + +## Running test + +All tests can be run by executing `/vendor/bin/phpunit tests --testdox`.