/**
*
* Factory class test.
*
*/
class Test_{:class} extends {:extends} {
/**
*
* Default configuration values.
*
* @var array
*
*/
protected $_Test_{:class} = 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 {:class}($this->_config);
$expect = '{:class}';
$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 {:class}($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('{:class}');
$expect = '{:class}_Adapter';
$this->assertInstance($actual, $expect);
}
}