PHP Classes

File: test/ssa/runner/resolver/impl/DefaultPrimitiveResolverTest.php

Recommend this page to a friend!
  Classes of thomas   SSA   test/ssa/runner/resolver/impl/DefaultPrimitiveResolverTest.php   Download  
File: test/ssa/runner/resolver/impl/DefaultPrimitiveResolverTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: SSA
Call PHP classes from JavaScript on Web pages
Author: By
Last change:
Date: 10 years ago
Size: 1,111 bytes
 

Contents

Class file image Download
<?php

namespace ssa\runner\resolver\impl;

use
ssa\runner\resolver\impl\DefaultPrimitiveResolver;

/**
 * Description of DefaultTypeResolver
 *
 * @author thomas
 */
class DefaultPrimitiveResolverTest extends \PHPUnit_Framework_TestCase {

    private
$primitiveResolver;

    public function
setUp() {
       
$this->primitiveResolver = new DefaultPrimitiveResolver();
    }


    public function
testResolvePrimitiveSimpleArray() {
       
$type = array('array');
       
$return = $this->primitiveResolver->resolvePrimitive('test', $type);
       
$this->assertEquals(array('test'), $return);
       
$return2 = $this->primitiveResolver->resolvePrimitive(array('test'), $type);
       
$this->assertEquals(array('test'), $return2);
    }
   
    public function
testResolvePrimitive() {
       
$type = array('string');
       
$return = $this->primitiveResolver->resolvePrimitive(123, $type);
       
$this->assertEquals('123',$return);
       
$type2 = array('int');
       
$return2 = $this->primitiveResolver->resolvePrimitive('123', $type2);
       
$this->assertEquals(123,$return2);
    }
}