PHP Classes

File: tests/api/Create/AndFindArticleCept.php

Recommend this page to a friend!
  Classes of Gjero Krsteski  >  PHP Nuclear Reactor  >  tests/api/Create/AndFindArticleCept.php  >  Download  
File: tests/api/Create/AndFindArticleCept.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Nuclear Reactor
Asynchronous RESTful API using ReactPHP and PIMF
Author: By
Last change: Update of tests/api/Create/AndFindArticleCept.php
Date: 2 years ago
Size: 680 bytes


Class file image Download
= new ApiTester($scenario);
$I->wantTo('create a article via API and find a article via api');
$I->haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded');
$I->sendPOST('/articles', ['title' => 'test title', 'content' => 'test content']);
$I->seeResponseMatchesJsonType(['newId' => 'integer']);

$body = json_decode($I->grabResponse());

'id' => 'integer',
'title' => 'string',
'content' => 'string',

For more information send a message to info at phpclasses dot org.