$t->info(' 1.1 - Trying to retrieve a non-existent theme object throws an exception'); try { $manager->getThemeObject('fake'); $t->fail('No exception thrown'); } catch (sfException $e) { $t->pass($e->getMessage()); } $t->info(' 1.2 - Play with the current theme'); $t->is($manager->getCurrentTheme(), false, '->getCurrentTheme() returns false when there is no theme set'); $t->is($manager->getCurrentThemeObject(), false, '->getCurrentThemeObject() return false when there is no theme set'); $t->info('2 - Set some themes and see what happens'); $manager = new sfThemeManager($context); $themeConfig = array('layout' => 'app_test_layout', 'stylesheets' => array('main'), 'javascripts' => array('main.js')); $t->info(' 2.1 - Setting a non-existent theme as current throws an exception'); try { $manager->setCurrentTheme('fake'); $t->fail('Exception not thrown'); } catch (sfException $e) { $t->pass($e->getMessage()); } $t->info(' 2.2 - Set a real theme with a bad layout name throws InvalidArgumentException'); $badThemeConfig = $themeConfig; $badThemeConfig['layout'] = 'non_existent'; $manager->addTheme('bad_theme', $badThemeConfig); try { $manager->setCurrentTheme('bad_theme'); $t->fail('No exception thrown'); } catch (InvalidArgumentException $e) { $t->pass($e->getMessage()); } $t->info(' 2.3 - Set a real, valid theme and view the results');