PHP Classes

File: tests/Jaguar/Tests/Drawable/Style/BrushTest.php

Recommend this page to a friend!
  Classes of Hyyan Abo Fakher   Jaguar   tests/Jaguar/Tests/Drawable/Style/BrushTest.php   Download  
File: tests/Jaguar/Tests/Drawable/Style/BrushTest.php
Role: Unit test script
Content type: text/plain
Description: Class source
Class: Jaguar
Draw graphics and manipulate images
Author: By
Last change: Update of tests/Jaguar/Tests/Drawable/Style/BrushTest.php
Date: 5 months ago
Size: 1,532 bytes
 

Contents

Class file image Download
<?php

/*
 * This file is part of the Jaguar package.
 *
 * (c) Hyyan Abo Fakher <tiribthea4hyyan@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Jaguar\Tests\Drawable\Style;

use
Jaguar\Drawable\Style\Brush;
use
Jaguar\Tests\Drawable\AbstractStyleTest;

class
BrushTest extends AbstractStyleTest
{

    public function
testApply()
    {
       
$brush = new Brush($this->getCanvas(),5,9);
       
$this->assertInstanceOf(
               
'\Jaguar\Color\StyledBrushedColor'
               
, $brush->apply($this->getCanvas(), $this->getDrawable())
        );
    }

   
/**
     * @expectedException \Jaguar\Exception\DrawableException
     */
   
public function testApplyThrowDrawableException()
    {
       
$brush = new Brush(new \Jaguar\Tests\Mock\CanvasMock());
       
$brush->apply($this->getCanvas(), $this->getDrawable());
    }

   
/**
     * @expectedException \RuntimeException
     */
   
public function testCloneThrowRuntimeException()
    {
       
$brush = new Brush($this->getCanvas());
        clone
$brush;
    }

   
/**
     * @expectedException \InvalidArgumentException
     */
   
public function testSetShowTimeThrowInvalidArgumentException()
    {
        new
Brush($this->getCanvas(), -5);
    }

   
/**
     * @expectedException \InvalidArgumentException
     */
   
public function testSetHideTimeThrowInvalidArgumentException()
    {
        new
Brush($this->getCanvas(), 1, -5);
    }

}