PHP Classes
elePHPant
Icontem

File: test/ResponseBehaviour/ConvertJsonToArrayBehaviourTest.php

Recommend this page to a friend!
  Classes of nvb  >  PHP Service Locator Generator  >  test/ResponseBehaviour/ConvertJsonToArrayBehaviourTest.php  >  Download  
File: test/ResponseBehaviour/ConvertJsonToArrayBehaviourTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHP Service Locator Generator
Generate locator classes from configuration files
Author: By
Last change: fixed bug with *ConvertJsonToArrayBehaviour*
Date: 3 years ago
Size: 728 bytes
 

Contents

Class file image Download
<?php
/**
 * @author stev leibelt <artodeto@bazzline.net>
 * @since: 2015-12-16
 */

namespace Test\Net\Bazzline\Component\Curl\ResponseBehaviour;

use
Net\Bazzline\Component\Curl\ResponseBehaviour\ConvertJsonToArrayBehaviour;
use
Test\Net\Bazzline\Component\Curl\AbstractTestCase;

class
ConvertJsonToArrayBehaviourTest extends AbstractTestCase
{
    public function
testBehaviour()
    {
       
$behaviour = new ConvertJsonToArrayBehaviour();
       
$response = $this->getNewResponse();

       
$behavedResponse = $behaviour->behave($response);
       
$expectedContent = json_decode($response->content(), true);

       
$this->assertEquals($expectedContent, $behavedResponse->content());
    }
}