0

I do:

$this->post('/v1/customer', ['area' => 'kil'])
        ->seeJson(['created' => true]);

But instead of created => true, I would like to do "NOT STATEMENTS". Ex: parent!=null or created_at > '0000-00-00'

How can this be achieved?

1
  • 1
    obtain the json response, decode it and use PHPUnit assertions Commented Sep 9, 2015 at 9:09

1 Answer 1

1

Laravel does have a dontSeeJson function which would solve both of the examples you've listed (though possibly not a more general case) --

$this->dontSeeJson(['parent' => null]);

$this->dontSeeJson(['created_at' => '0000-00-00']);

If you need something more specific, I agree with @gontrollez - decode the json (json_decode($this->response->getContent(), true)) and test that.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes. Thats the way I went. Was hoping for a better way though. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.