Login   Register  
PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2013-02-26 03:31
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());
    }
}