PHP Classes

File: tests/org/majkel/tcpdfwarper/UtilsTest.php

Recommend this page to a friend!
  Classes of Michal Kowalik   TCPDF Warper   tests/org/majkel/tcpdfwarper/UtilsTest.php   Download  
File: tests/org/majkel/tcpdfwarper/UtilsTest.php
Role: Unit test script
Content type: text/plain
Description: Utility functions tests
Class: TCPDF Warper
Create PDF documents using TCPDF fluent interface
Author: By
Last change: Update of tests/org/majkel/tcpdfwarper/UtilsTest.php
Date: 11 months ago
Size: 934 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: 20:41
 */

namespace org\majkel\tcpdfwarper;

require_once
'AbstractTestCase.php';

/**
 * Class WriteOpTest
 * @package org\majkel\tcpdfwarper
 * @coversDefaultClass \org\majkel\tcpdfwarper\Utils
 */
class UtilsTest extends AbstractTestCase {

   
/**
     * @return array
     */
   
public function dataGetKeyAsArray() {
        return [
            [[],
'missing key', []],
            [[
'k' => 'v'], 'k', []],
            [[
'k' => []], 'k', []],
            [[
'k' => [1, 2, 3]], 'k', [1, 2, 3]],
            [
null, 'k', []],
            [[],
null, []],
            [
null, null, []],
        ];
    }

   
/**
     * @param $array
     * @param $key
     * @param $excepted
     * @dataProvider dataGetKeyAsArray
     * @covers ::getKeyAsArray
     */
   
public function testGetKeyAsArray($array, $key, $excepted) {
       
self::assertSame($excepted, Utils::getKeyAsArray($array, $key));
    }
}