Source of file TestCase.php

Size: 1,491 Bytes - Last Modified: 2015-12-22T09:12:14-05:00

../src/TestCase.php

1234567891011121314151617181920212223242526272829303132333435363738394041
Covered by 31 test(s):
  • MvcLite\CacheTest::testInit with data set "with prefix"
  • MvcLite\CacheTest::testInit with data set "without prefix"
  • MvcLite\ConfigTest::testSet with data set #0
  • MvcLite\ConfigTest::testSet with data set #1
  • MvcLite\ConfigTest::testSet with data set #2
  • MvcLite\ConfigTest::testSet with data set #3
  • MvcLite\ConfigTest::testSet with data set #4
  • MvcLite\ConfigTest::testGet with data set "key exists, expect value"
  • MvcLite\ConfigTest::testGet with data set "key does not exist, do notexpect value"
  • MvcLite\ErrorTest::testGetErrors with data set #0
  • MvcLite\FileTest::testLoad with data set "Good path, should exist"
  • MvcLite\FileTest::testGetContents with data set "string contents"
  • MvcLite\FileTest::testGetContents with data set "whitespace contents"
  • MvcLite\FilterChainTest::testFilter with data set "simple test"
  • MvcLite\RequestTest::testGetHeaders with data set "simple test"
  • MvcLite\RequestTest::testIsAjax
  • MvcLite\RequestTest::testGetUri
  • MvcLite\SessionTest::testInit with data set "simple test"
  • MvcLite\SessionTest::testGetParams with data set "simple test"
  • MvcLite\LoaderTraitsTest::testGetLoader
  • MvcLite\ViewTest::testGetFormat
  • MvcLite\ViewTest::testGetHelper with data set "Csv helper"
  • MvcLite\ViewTest::testGetHelper with data set "Exception helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputCheckbox helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputPassword helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSelect helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSubmit helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputTextarea helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper, but already has it"
  • MvcLite\ViewTest::testGetHelper with data set "Bad Helper, expect exception"
42
Covered by 31 test(s):
  • MvcLite\CacheTest::testInit with data set "with prefix"
  • MvcLite\CacheTest::testInit with data set "without prefix"
  • MvcLite\ConfigTest::testSet with data set #0
  • MvcLite\ConfigTest::testSet with data set #1
  • MvcLite\ConfigTest::testSet with data set #2
  • MvcLite\ConfigTest::testSet with data set #3
  • MvcLite\ConfigTest::testSet with data set #4
  • MvcLite\ConfigTest::testGet with data set "key exists, expect value"
  • MvcLite\ConfigTest::testGet with data set "key does not exist, do notexpect value"
  • MvcLite\ErrorTest::testGetErrors with data set #0
  • MvcLite\FileTest::testLoad with data set "Good path, should exist"
  • MvcLite\FileTest::testGetContents with data set "string contents"
  • MvcLite\FileTest::testGetContents with data set "whitespace contents"
  • MvcLite\FilterChainTest::testFilter with data set "simple test"
  • MvcLite\RequestTest::testGetHeaders with data set "simple test"
  • MvcLite\RequestTest::testIsAjax
  • MvcLite\RequestTest::testGetUri
  • MvcLite\SessionTest::testInit with data set "simple test"
  • MvcLite\SessionTest::testGetParams with data set "simple test"
  • MvcLite\LoaderTraitsTest::testGetLoader
  • MvcLite\ViewTest::testGetFormat
  • MvcLite\ViewTest::testGetHelper with data set "Csv helper"
  • MvcLite\ViewTest::testGetHelper with data set "Exception helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputCheckbox helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputPassword helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSelect helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSubmit helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputTextarea helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper, but already has it"
  • MvcLite\ViewTest::testGetHelper with data set "Bad Helper, expect exception"
43
Covered by 31 test(s):
  • MvcLite\CacheTest::testInit with data set "with prefix"
  • MvcLite\CacheTest::testInit with data set "without prefix"
  • MvcLite\ConfigTest::testSet with data set #0
  • MvcLite\ConfigTest::testSet with data set #1
  • MvcLite\ConfigTest::testSet with data set #2
  • MvcLite\ConfigTest::testSet with data set #3
  • MvcLite\ConfigTest::testSet with data set #4
  • MvcLite\ConfigTest::testGet with data set "key exists, expect value"
  • MvcLite\ConfigTest::testGet with data set "key does not exist, do notexpect value"
  • MvcLite\ErrorTest::testGetErrors with data set #0
  • MvcLite\FileTest::testLoad with data set "Good path, should exist"
  • MvcLite\FileTest::testGetContents with data set "string contents"
  • MvcLite\FileTest::testGetContents with data set "whitespace contents"
  • MvcLite\FilterChainTest::testFilter with data set "simple test"
  • MvcLite\RequestTest::testGetHeaders with data set "simple test"
  • MvcLite\RequestTest::testIsAjax
  • MvcLite\RequestTest::testGetUri
  • MvcLite\SessionTest::testInit with data set "simple test"
  • MvcLite\SessionTest::testGetParams with data set "simple test"
  • MvcLite\LoaderTraitsTest::testGetLoader
  • MvcLite\ViewTest::testGetFormat
  • MvcLite\ViewTest::testGetHelper with data set "Csv helper"
  • MvcLite\ViewTest::testGetHelper with data set "Exception helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputCheckbox helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputPassword helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSelect helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputSubmit helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputTextarea helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper"
  • MvcLite\ViewTest::testGetHelper with data set "InputText helper, but already has it"
  • MvcLite\ViewTest::testGetHelper with data set "Bad Helper, expect exception"
44454647484950515253545556
Covered by 10 test(s):
  • MvcLite\CacheTest::testGetFilepath with data set "string filepath, string expectations"
  • MvcLite\CacheTest::testGetFilepath with data set "empty filepath, empty expectations"
  • MvcLite\DispatcherTest::testTranslateControllerName with data set "simple"
  • MvcLite\DispatcherTest::testTranslateControllerName with data set "with dashes"
  • MvcLite\DispatcherTest::testTranslateActionName with data set "simple"
  • MvcLite\DispatcherTest::testTranslateActionName with data set "with dashes"
  • MvcLite\FormTest::testGetElementTypeMap
  • MvcLite\ViewHelperInputSelectTest::testBuildOptions with data set "empty options"
  • MvcLite\ViewHelperInputSelectTest::testBuildOptions with data set "single option"
  • MvcLite\ViewHelperAbstractTest::testGetHtmlAttribs with data set #0
57
Covered by 10 test(s):
  • MvcLite\CacheTest::testGetFilepath with data set "string filepath, string expectations"
  • MvcLite\CacheTest::testGetFilepath with data set "empty filepath, empty expectations"
  • MvcLite\DispatcherTest::testTranslateControllerName with data set "simple"
  • MvcLite\DispatcherTest::testTranslateControllerName with data set "with dashes"
  • MvcLite\DispatcherTest::testTranslateActionName with data set "simple"
  • MvcLite\DispatcherTest::testTranslateActionName with data set "with dashes"
  • MvcLite\FormTest::testGetElementTypeMap
  • MvcLite\ViewHelperInputSelectTest::testBuildOptions with data set "empty options"
  • MvcLite\ViewHelperInputSelectTest::testBuildOptions with data set "single option"
  • MvcLite\ViewHelperAbstractTest::testGetHtmlAttribs with data set #0
58
Covered by 10 test(s):
  • MvcLite\CacheTest::testGetFilepath with data set "string filepath, string expectations"
  • MvcLite\CacheTest::testGetFilepath with data set "empty filepath, empty expectations"
  • MvcLite\DispatcherTest::testTranslateControllerName with data set "simple"
  • MvcLite\DispatcherTest::testTranslateControllerName with data set "with dashes"
  • MvcLite\DispatcherTest::testTranslateActionName with data set "simple"
  • MvcLite\DispatcherTest::testTranslateActionName with data set "with dashes"
  • MvcLite\FormTest::testGetElementTypeMap
  • MvcLite\ViewHelperInputSelectTest::testBuildOptions with data set "empty options"
  • MvcLite\ViewHelperInputSelectTest::testBuildOptions with data set "single option"
  • MvcLite\ViewHelperAbstractTest::testGetHtmlAttribs with data set #0
596061
<?php
/**
 * TestCase Class.
 *
 * @category   PHP
 * @package    MVCLite
 * @subpackage Tests
 * @since      File available since release 3.0.x
 * @author     Cory Collier <corycollier@corycollier.com>
 */

namespace MvcLite;

/**
 * TestCase Class.
 *
 * @category   PHP
 * @package    MVCLite
 * @subpackage Tests
 * @since      File available since release 3.0.x
 * @author     Cory Collier <corycollier@corycollier.com>
 */
class TestCase extends \PHPUnit_Framework_TestCase
{
    /**
     * Subject Under Testing
     * @var mixed
     */
    protected $sut;

    /**
     * Gets an instance of \ReflectionProperty, for a given class and property.
     *
     * @param string $class The class to perform reflection on.
     * @param string $property The property to reflect on.
     *
     * @return \ReflectionProperty
     */
    protected function getReflectedProperty($class, $property)
    {
        $property = new \ReflectionProperty($class, $property);
        $property->setAccessible(true);
        return $property;
    }

    /**
     * Gets an instance of \ReflectionMethod, for a given class and method.
     *
     * @param string $class The class to perform reflection on.
     * @param string $method The method to reflect on.
     *
     * @return \ReflectionMethod
     */
    protected function getReflectedMethod($class, $method)
    {
        $method = new \ReflectionMethod($class, $method);
        $method->setAccessible(true);
        return $method;
    }
}