10 $factory->register(
'fallback',
'Fallback',
function () {
13 $this->assertTrue(
true );
14 $this->setExpectedException(
'InvalidArgumentException' );
15 $factory->register(
'invalid',
'Invalid',
'Invalid callback' );
23 $this->setExpectedException(
'SkinException' );
24 $factory->makeSkin(
'nobuilderregistered' );
32 $factory->register(
'unittest',
'Unittest',
function () {
35 $this->setExpectedException(
'UnexpectedValueException' );
36 $factory->makeSkin(
'unittest' );
44 $factory->register(
'testfallback',
'TestFallback',
function () {
48 $skin = $factory->makeSkin(
'testfallback' );
49 $this->assertInstanceOf(
'Skin',
$skin );
50 $this->assertInstanceOf(
'SkinFallback',
$skin );
59 $callback =
function () {
62 $factory->register(
'skin1',
'Skin1', $callback );
63 $factory->register(
'skin2',
'Skin2', $callback );
64 $names = $factory->getSkinNames();
65 $this->assertArrayHasKey(
'skin1', $names );
66 $this->assertArrayHasKey(
'skin2', $names );
67 $this->assertEquals(
'Skin1', $names[
'skin1'] );
68 $this->assertEquals(
'Skin2', $names[
'skin2'] );