Location: PHPKode > projects > Moc10 PHP Library > tests/Moc10/AutoloaderTest.php
<?php
/**
 * Moc10 Library
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.TXT.
 * It is also available through the world-wide-web at this URL:
 * http://www.moc10phplibrary.com/LICENSE.TXT
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to hide@address.com so we can send you a copy immediately.
 *
 * @category   Moc10
 * @package    Moc10_Autoloader
 * @author     Nick Sagona, III <hide@address.com>
 * @copyright  Copyright (c) 2009-2011 Moc 10 Media, LLC. (http://www.moc10media.com)
 * @license    http://www.moc10phplibrary.com/LICENSE.TXT     New BSD License
 */

// Require the library's autoloader.
require_once dirname(__FILE__) . '/../../library/Moc10/Autoloader.php';

// Set the include path of the application.
set_include_path(dirname(__FILE__) . '/../../application/' . PATH_SEPARATOR . get_include_path());

// Call the autoloader's bootstrap function.
Moc10_Autoloader::bootstrap();

class Moc10_AutoloaderTest extends PHPUnit_Framework_TestCase
{

    public function testAutoloaderLibrary()
    {

        $s = new Moc10_String('string');
        $class = 'Moc10_String';
        $this->assertTrue($s instanceof $class);

    }


    public function testAutoloaderApplication()
    {

        $f = new Test_Form_Contact('/some-action.php', 'post');
        $parent = 'Moc10_Form';
        $class = 'Test_Form_Contact';
        $this->assertTrue($f instanceof $parent);
        $this->assertTrue($f instanceof $class);

    }

}

?>
Return current item: Moc10 PHP Library