PHP Classes

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

Recommend this page to a friend!
  Classes of Hyyan Abo Fakher   Jaguar   tests/Jaguar/Tests/Drawable/ArcTest.php   Download  
File: tests/Jaguar/Tests/Drawable/ArcTest.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/ArcTest.php
Date: 4 months ago
Size: 1,681 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\Arc;
use
Jaguar\Dimension;

class
ArcTest extends FilledDrawableTest
{

    public function
getDrawable()
    {
        return new
Arc(new Dimension(100, 100));
    }

    public function
testEquals()
    {

       
$arc = new Arc();
       
$clone = clone $arc;

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

       
$clone->getCenter()->move(50, 50);

       
$this->assertFalse($clone->equals($arc));

       
$clone->getCenter()->move(0, 0);
       
$clone->setStartDegree(-90);

       
$this->assertFalse($clone->equals($arc));

       
$clone->setStartDegree(0);
       
$clone->setEndDegree(180);

       
$this->assertFalse($clone->equals($arc));

       
$clone->setEndDegree(360);
       
$clone->getDimension()->resize(500, 500);

       
$this->assertFalse($clone->equals($arc));

       
$clone->getDimension()->resize(0, 0);
       
$clone->setRounded(false); // default true

       
$this->assertFalse($clone->equals($arc));

       
$clone->setRounded(true);
       
$clone->connectAngles(true); // default false

       
$this->assertFalse($clone->equals($arc));

       
$clone->connectAngles(false);
       
$clone->connectAnglesToCenter(true); // default false

       
$this->assertFalse($clone->equals($arc));

       
$clone->connectAnglesToCenter(false);
       
$clone->getColor()->setRed(255);

       
$this->assertFalse($clone->equals($arc));
    }

}