Location: PHPKode > projects > SolarPHP > solar-system-1.1.1/solar/source/solar/tests/Test/Solar/Http/Request.php
<?php
/**
 * 
 * Factory class test.
 * 
 */
class Test_Solar_Http_Request extends Solar_Test {
    
    /**
     * 
     * Default configuration values.
     * 
     * @var array
     * 
     */
    protected $_Test_Solar_Http_Request = array(
    );
    
    /**
     * 
     * Test -- Constructor.
     * 
     */
    public function test__construct()
    {
        // we use `new` instead of Solar::factory() so that we get back the
        // factory class itself, not an adapter generated by the factory
        $actual = new Solar_Http_Request($this->_config);
        $expect = 'Solar_Http_Request';
        $this->assertInstance($actual, $expect);
    }
    
    /**
     * 
     * Test -- Disallow all calls to methods besides factory() and the existing support methods.
     * 
     */
    final public function test__call()
    {
        // we use `new` instead of Solar::factory() so that we get back the
        // factory class itself, not an adapter generated by the factory
        $obj = new Solar_Http_Request($this->_config);
        try {
            $obj->noSuchMethod();
            $this->fail('__call() should not work');
        } catch (Exception $e) {
            $this->assertTrue(true);
        }
    }
    
    /**
     * 
     * Test -- Factory method for returning adapter objects.
     * 
     */
    public function testFactory()
    {
        $actual = Solar::factory('Solar_Http_Request');
        $expect = 'Solar_Http_Request_Adapter';
        $this->assertInstance($actual, $expect);
    }
}
Return current item: SolarPHP