PHP Classes

File: tests/api/Create/ArticleCept.php

Recommend this page to a friend!
  Classes of Gjero Krsteski   PHP Nuclear Reactor   tests/api/Create/ArticleCept.php   Download  
File: tests/api/Create/ArticleCept.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/ArticleCept.php
Date: 4 years ago
Size: 377 bytes
 

Contents

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