PHP Classes

File: tests/org/majkel/tcpdfwarper/generator/ConfigItemTest.php

Recommend this page to a friend!
  Classes of Michal Kowalik   TCPDF Warper   tests/org/majkel/tcpdfwarper/generator/ConfigItemTest.php   Download  
File: tests/org/majkel/tcpdfwarper/generator/ConfigItemTest.php
Role: Unit test script
Content type: text/plain
Description: test generator
Class: TCPDF Warper
Create PDF documents using TCPDF fluent interface
Author: By
Last change: Update of tests/org/majkel/tcpdfwarper/generator/ConfigItemTest.php
Date: 7 months ago
Size: 1,199 bytes
 

Contents

Class file image Download
<?php
/**
 * Created by PhpStorm.
 * Package: org\majkel\tcpdfwarper
 * User: Micha? (majkel) Kowalik <maf.michal@gmail.com>
 * Date: 12/28/2014
 * Time: 22:36
 */

namespace org\majkel\tcpdfwarper\generator;

/**
 * Class ConfigItemTest
 * @package org\majkel\tcpdfwarper\generator
 * @coversDefaultClass \org\majkel\tcpdfwarper\generator\ConfigItem
 */
class ConfigItemTest extends \PHPUnit_Framework_TestCase {

   
/**
     * @covers ::fromArray
     */
   
public function testFromArray() {
       
$additionalDoc = array(
               
'x' => 'doc',
        );
       
$obj = ConfigItem::fromArray(array(
               
'method' => 1,
               
'className' => 2,
               
'metaMethods' => array(
                        array(
                               
'name' => 1,
                               
'args' => array(2),
                               
'doc' => 3,
                        ),
                ),
               
'additionalDoc' => $additionalDoc,
        ));
       
self::assertSame(1, $obj->method);
       
self::assertSame(2, $obj->name);
       
self::assertSame('2Op', $obj->className);
       
self::assertSame('2Op', $obj->className);
       
self::assertSame($additionalDoc, $obj->additionalDoc);
    }

   
/**
     * @covers ::fromArray
     * @expectedException \org\majkel\tcpdfwarper\generator\GeneratorException
     */
   
public function testFromArrayException() {
       
ConfigItem::fromArray(array());
    }

}