Location: PHPKode > projects > Xyster Framework > xyster-02build01/xyster-02build01/tests/Xyster/Controller/Action/InjectorTest.php
<?php
/**
 * Xyster Framework
 *
 * 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.opensource.org/licenses/bsd-license.php
 *
 * @category  Xyster
 * @package   UnitTests
 * @subpackage Xyster_Controller
 * @copyright Copyright LibreWorks, LLC (http://libreworks.net)
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @version   $Id$
 */
namespace XysterTest\Controller\Action;
use Xyster\Controller\Action\Injector;
require_once dirname(dirname(__FILE__)) . '/_files/BarController.php';

/**
 * Test class for Xyster_Controller_Action_Injector.
 * Generated by PHPUnit on 2008-05-28 at 15:55:43.
 */
class InjectorTest extends \PHPUnit_Framework_TestCase
{    
    /**
     * Tests the basic operation of the class
     */
    public function testGet()
    {
        \BarController::$called['baz'] = 0;
        \BarController::$called['test'] = 0;
        \BarController::$called['setObject'] = 0;
        
        $container = new \Xyster\Container\Container;
        $container->autowire('\SplObjectStorage');
        $request = new \Zend_Controller_Request_Simple('baz', 'bar', null, array());
        $response = new \Zend_Controller_Response_Cli;
        $object = new Injector(\Xyster\Container\Container::definition('\BarController'), $request, $response);
        $controller = $object->get($container);
        $this->assertType('\BarController', $controller);
        $this->assertType('\SplObjectStorage', $controller->object);
    }
}
Return current item: Xyster Framework