This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I’m writing RESTful APIs using OctoberCMS, and it’s great. But I seemed to have hit a roadblock, how exactly am I supposed to write network test operations? I’ve tried checking the OctoberCMS documentation and it doesn’t suggest anything. The laravel docs suggest this but when I use the call method from within a plugin test like this:
$response = $this->call('POST', '/api/v1/post’, [’title’ => ’Some random article']);
And I get this error
ErrorException: Undefined property: Acme\Blog\Tests\PostTest::$baseUrl
Basically my goal is to write test cases so I can impersonate Http requests and then the API would actually create the data in the Db and then I just verify if that’s exactly the expected output. Any ideas on how I can do this?
Did you extend the TestCase
class in your own test class?
class YourTest extends TestCase {
}
1-3 of 3