PHP Classes

File: tests/Proxy/ImagineProxyTest.php

Recommend this page to a friend!
  Classes of Kacper Rowinski   OneClickCaptcha   tests/Proxy/ImagineProxyTest.php   Download  
File: tests/Proxy/ImagineProxyTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: OneClickCaptcha
CAPTCHA validation based on user clicks on circles
Author: By
Last change: Update of tests/Proxy/ImagineProxyTest.php
Date: 11 months ago
Size: 1,448 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);

use
Imagine\Image\Palette\RGB;
use
Imagine\Image\Point;
use
Imagine\Image\Box;
use
Imagine\Image\ImagineInterface;
use
OneClickCaptcha\Proxy\ImageProxy;
use
PHPUnit\Framework\TestCase;

/**
 * Class ImagineProxyTest
 */
class ImagineProxyTest extends TestCase
{
   
/**
     * @var ImageProxy
     */
   
private $imagineProxy;

    public function
setUp()
    {
       
/**
         * @var Imagine\Image\ImagineInterface $stub
         */
       
$stub = $this->getMockBuilder(ImagineInterface::class)
            ->
disableOriginalConstructor()
            ->
getMock();

       
$this->imagineProxy = new ImageProxy($stub);
    }

   
/**
     * @test
     */
   
public function shouldReturnInstanceOfBox(): void
   
{
       
$this->assertInstanceOf(Box::class, $this->imagineProxy->getBox(1, 1));
    }

   
/**
     * @test
     */
   
public function shouldReturnInstanceOfPoint(): void
   
{
       
$this->assertInstanceOf(Point::class, $this->imagineProxy->getPoint(1, 1));
    }

   
/**
     * @test
     */
   
public function shouldReturnInstanceOfRGB(): void
   
{
       
$this->assertInstanceOf(RGB::class, $this->imagineProxy->getRGB());
    }

   
/**
     * @test
     */
   
public function shouldReturnInstanceOfImagine(): void
   
{
       
$this->assertInstanceOf(ImagineInterface::class, $this->imagineProxy->getImage());
    }
}