PHP Classes

File: test/WebPower/gcm/server/InvalidRequestExceptionTest.php

Recommend this page to a friend!
  Classes of Christiaan Baartse   PHP Google Cloud Messaging Server   test/WebPower/gcm/server/InvalidRequestExceptionTest.php   Download  
File: test/WebPower/gcm/server/InvalidRequestExceptionTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHP Google Cloud Messaging Server
Send messages to Android applications using GCM
Author: By
Last change:
Date: 11 years ago
Size: 853 bytes
 

Contents

Class file image Download
<?php
namespace WebPower\gcm\server;

class
InvalidRequestExceptionTest extends \PHPUnit_Framework_TestCase
{
    public function
testGettersNoDescription()
    {
       
$exception = new InvalidRequestException(401);
       
$this->assertEquals(401, $exception->getHttpStatusCode());
       
$this->assertNull($exception->getDescription());
       
$this->assertContains("401", $exception->getMessage(), $exception->getMessage());
    }

    public function
testGettersDescription()
    {
       
$exception = new InvalidRequestException(401, "D'OH!");
       
$this->assertEquals(401, $exception->getHttpStatusCode());
       
$this->assertEquals("D'OH!", $exception->getDescription());
       
$this->assertContains("401", $exception->getMessage(), $exception->getMessage());
       
$this->assertContains("D'OH!", $exception->getMessage());
    }
}