Skip to content

Commit

Permalink
Add default version for theme scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
cgiupponi committed Aug 30, 2018
1 parent 8fd4651 commit cdad9b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Modules/Workshop/Scaffold/Theme/stubs/themeJson.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "{{theme-name}}",
"description": "",
"type": "{{type}}"
"type": "{{type}}",
"version": "1.0.0"
}
11 changes: 11 additions & 0 deletions Modules/Workshop/Tests/ThemeScaffoldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,15 @@ public function it_creates_empty_assets_folder()
$this->assertTrue($this->finder->isFile($this->testThemePath . '/assets/js/.gitignore'));
$this->assertTrue($this->finder->isFile($this->testThemePath . '/assets/images/.gitignore'));
}

/** @test */
public function it_has_default_version_in_theme_json_file()
{
$this->scaffold->setFiles(['themeJson']);

$this->generateFrontendTheme();

$this->assertTrue($this->finder->isFile($this->testThemePath . '/theme.json'));
$this->assertTrue(str_contains($this->finder->get($this->testThemePath . '/theme.json'), '"version": "1.0.0"'));
}
}

0 comments on commit cdad9b6

Please sign in to comment.