Example #1
0
 /**
  * @param null|string $basePath
  *
  * @throws \ThemeManager\Exceptions\MissingThemesFolder - When themes folder does not exist
  */
 private function setThemeFolder($basePath = null)
 {
     $this->themesFolder = $basePath ?: themes_base_path();
     if (!is_dir($this->themesFolder)) {
         throw new MissingThemesFolder($this->themesFolder);
     }
 }
 public function setUp()
 {
     $this->theme = new Theme(themes_base_path() . '/demo');
     $this->themeArray = [$this->theme];
     $this->collection = new ThemeCollection($this->themeArray);
 }
 public function __construct($createdPath = null, $code = 0, Exception $previous = null)
 {
     $message = 'Expecting themes folder at ' . ($createdPath ?: themes_base_path());
     parent::__construct($message, $code, $previous);
 }
Example #4
0
 /**
  * @test
  * @group starter
  *
  * @expectedException \ThemeManager\Exceptions\EmptyThemeName
  */
 public function testStartExceptionHandlerEmptyName()
 {
     $path = themes_base_path() . '/../themes-test';
     (new Starter())->start($path, [], true);
 }
 /**
  * @test
  * @group manager
  */
 public function testAddThemeLocationWithBadData()
 {
     $this->assertEquals(1, $this->themeManager->getInvalidThemesCount());
     $addPath = themes_base_path() . '/../themes-test';
     $this->themeManager->addThemeLocation($addPath);
     $this->assertNotEmpty($this->themeManager->getInvalidThemes());
     $this->assertEquals(3, $this->themeManager->getInvalidThemesCount());
 }
Example #6
0
 /**
  * @test
  * @group theme
  *
  * @expectedException \ThemeManager\Exceptions\EmptyThemeName
  */
 public function testThrowsThemeEmptyName()
 {
     new Theme(themes_base_path() . '/../themes-test/empty-name');
 }
 /**
  * @test
  * @group manager
  *
  * @expectedException \ThemeManager\Exceptions\NoThemeName
  */
 public function testAddThemeLocationNoThemeNameError()
 {
     $this->setUpAlternative(themes_base_path() . '/../themes-alternative', ['name', 'version'], true);
     $addPath = themes_base_path();
     $this->themeManager->addThemeLocation($addPath);
 }