PHP Classes

File: tests/Jaguar/Tests/Drawable/TextTest.php

Recommend this page to a friend!
  Classes of Hyyan Abo Fakher   Jaguar   tests/Jaguar/Tests/Drawable/TextTest.php   Download  
File: tests/Jaguar/Tests/Drawable/TextTest.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/TextTest.php
Date: 2 months ago
Size: 1,469 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;

use
Jaguar\Drawable\Text;

class
TextTest extends AbstractDrawableTest
{

    public function
getDrawable()
    {
        return new
Text('Jaguar Rocks!');
    }

    public function
testGetBoundingBox()
    {
       
$this->assertInstanceOf('\Jaguar\Box', $this->getDrawable()->getBoundingBox());
    }

   
/**
     * @expectedException \InvalidArgumentException
     */
   
public function testSetLineSpacingThrowInvalidArgumentException()
    {
       
$this->getDrawable()->setLineSpacing(-9);
    }

    public function
testEquals()
    {
       
$text = $this->getDrawable();
       
$clone = clone $text;

       
$this->assertTrue($text->equals($clone));

       
$clone->setString('Changed The String');
       
$this->assertFalse($text->equals($clone));

       
$clone->setString($text->getString());
       
$clone->setAngle(90);
       
$this->assertFalse($text->equals($clone));

       
$clone->setAngle(0);
       
$clone->getFont()->setFontSize(50);
       
$this->assertFalse($text->equals($clone));

       
$clone->getFont()->setFontSize($text->getFont()->getFontSize());
       
$clone->getColor()->setRed(255);
       
$this->assertFalse($text->equals($clone));
    }

}