diff --git a/CHANGELOG.md b/CHANGELOG.md index 613bae72..055aa470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,122 +1,127 @@ -###3.7.2### +### 3.8.0 ### +- Renamed package to nerds-and-company/schematic +- Added info about nerds-and-company/schematic-commerce to README +- Small fixes + +### 3.7.2 ### - Use handles for element index settings -###3.7.1### +### 3.7.1 ### - Removed Asset Transform dimensionChangeTime attribute from schema -###3.7.0### +### 3.7.0 ### - Added support for importing/exporting Asset Transforms - Asset Sources now respect the force option -###3.6.1### +### 3.6.1 ### - Don't care about instable plugin database update outcome -###3.6.0### +### 3.6.0 ### - Delete old blocktypes from matrixfields on force. (thanks to @Zae) - Beware backwards compatibility for the custom Field Models. There is now a $force parameter on the populate method. -###3.5.2### +### 3.5.2 ### - Fixed a bug where removed fields were not flushed properly from the in-memory cache - Updated Console component with latest Craft updates and fixes - Updated YAML component -###3.5.1### +### 3.5.1 ### - Log error in stead of throwing exception when failing to save new plugin info - Added support for >= Craft 2.6.2951's new constants, CRAFT_VENDOR_PATH and CRAFT_FRAMEWORK_PATH -###3.5.0### +### 3.5.0 ### - Added ability to exclude datatypes from export. (thanks to @spoik) -###3.4.3### +### 3.4.3 ### - Set publicURLs to true by default for asset sources to be compatible with craft 2.6.2794 -###3.4.2### +### 3.4.2 ### - Fixed asset import bug where the source was never set. (thanks to @roelvanhintum) -###3.4.1### +### 3.4.1 ### - Fix elevated user sessions (closes #59) - Bugfix in field asset sources -###3.4.0### +### 3.4.0 ### - Schematic now also exports and imports tag groups -###3.3.2### +### 3.3.2 ### - Allow 'singles' as a source -###3.3.1### +### 3.3.1 ### - Return empty string when field source not found at import -###3.3.0### +### 3.3.0 ### - Schematic now also exports and imports category groups (thanks to @smcyr, closes #31) - Only run updateDatabase for craft when craft db migrations are needed -###3.2.2### +### 3.2.2 ### - Improved the Craft and plugin updating/migrating mechanism - Fixed a bug where element index settings wheren't imported (closes #49) -###3.2.1### +### 3.2.1 ### - Also delete entrytypes which are not in the schema when using force -###3.2.0### +### 3.2.0 ### - Added ability to set craft constants through env variables (thanks to @roelvanhintum) - Fixed assetsource fieldlayout backwards compatibility -###3.1.6### +### 3.1.6 ### - Adds install and more detailed usage documentation -###3.1.5### +### 3.1.5 ### - Added support for Asset fieldlayouts (thanks to @roelvanhintum) -###3.1.4### +### 3.1.4 ### - Reset craft field service cache before each import - Get section entry types by section id in stead of from section -###3.1.3### +### 3.1.3 ### - Added array_key_exists checks for AssetField settings -###3.1.2### +### 3.1.2 ### - Sections are not imported when nothing has changed - Fields are not imported when nothing has changed - Field import is repeated after everything else has been imported to make sure sources are set correctly -###3.1.1### +### 3.1.1 ### - Folders are now CamelCased to add support for case-sensitive systems and PSR-4 (thanks to @ostark and @ukautz) -###3.1.0### +### 3.1.0 ### - Added support for element index settings (Craft 2.5 only) -###3.0.1### +### 3.0.1 ### - Schematic now also runs Craft migrations -###3.0.0### +### 3.0.0 ### - Schematic is now PSR-4 compatible and uses proper autoloading - Renamed assets to assetSources - Renamed globals to globalSets -###2.0.0### +### 2.0.0 ### - Reworked Schematic to install Craft when it's not installed yet - Added support for site locales - Fixed plugin installing on case-sensitive operating systems - Fixed field context setting too late - More verbose logging without backtrace -###1.4.0### +### 1.4.0 ### - Reworked importing and exporting of fields - Added hook to allow the addition of custom logic for importing and exporting fields - Permissions are now sorted -###1.3.0### +### 1.3.0 ### - Added the ability to use an override file -###1.2.0### +### 1.2.0 ### - Use 2 spaces indent in yaml file - Added user fields support - Automatically run migrations on plugin update - More verbose logging in devMode -###1.1.0### +### 1.1.0 ### - Replaced custom error handling with existing error handling - Refactored import/export with yaml support -###1.0.0### +### 1.0.0 ### - Initial release diff --git a/README.md b/README.md index 5dcd455d..1bd15cb5 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,10 @@ class Plugin_CustomSchematicFieldModel extends \NerdsAndCompany\Schematic\Models ``` +## See also + +For synchronizing Craft Commerce schema's, please see the [Schematic Commerce](https://github.com/nerds-and-company/schematic-commerce) package. + ## License This project has been licensed under the MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/composer.json b/composer.json index c53b7daa..e0f0543e 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "itmundi/schematic", + "name": "nerds-and-company/schematic", "description": "Craft setup and sync tool", "authors": [ { diff --git a/tests/Services/AssetSourcesTest.php b/tests/Services/AssetSourcesTest.php index bd899fc7..16413a90 100644 --- a/tests/Services/AssetSourcesTest.php +++ b/tests/Services/AssetSourcesTest.php @@ -71,25 +71,25 @@ public function testSuccessfulImport(array $assetSourceDefinitions) $this->assertFalse($import->hasErrors()); } - /** - * @covers ::import - * @dataProvider provideValidAssetSourceDefinitions - * - * @param array $assetSourceDefinitions - */ - public function testImportWithForceOption(array $assetSourceDefinitions) - { - $this->setMockAssetSourcesService(); - $this->setMockDbConnection(); - $this->setMockSchematicFields(); - - $schematicAssetSourcesService = new AssetSources(); - - $import = $schematicAssetSourcesService->import($assetSourceDefinitions, true); - - $this->assertInstanceOf(Result::class, $import); - $this->assertFalse($import->hasErrors()); - } + /** + * @covers ::import + * @dataProvider provideValidAssetSourceDefinitions + * + * @param array $assetSourceDefinitions + */ + public function testImportWithForceOption(array $assetSourceDefinitions) + { + $this->setMockAssetSourcesService(); + $this->setMockDbConnection(); + $this->setMockSchematicFields(); + + $schematicAssetSourcesService = new AssetSources(); + + $import = $schematicAssetSourcesService->import($assetSourceDefinitions, true); + + $this->assertInstanceOf(Result::class, $import); + $this->assertFalse($import->hasErrors()); + } //============================================================================================================== //============================================== PROVIDERS =================================================== diff --git a/tests/Services/AssetTransformsTest.php b/tests/Services/AssetTransformsTest.php index ae8d5ef1..002a5567 100644 --- a/tests/Services/AssetTransformsTest.php +++ b/tests/Services/AssetTransformsTest.php @@ -65,24 +65,24 @@ public function testSuccessfulImport(array $assetTransformDefinitions) $this->assertFalse($import->hasErrors()); } - /** - * @covers ::import - * @dataProvider provideValidAssetTransformDefinitions - * - * @param array $assetTransformDefinitions - */ - public function testImportWithForceOption(array $assetTransformDefinitions) - { - $this->setMockAssetTransformsService(); - $this->setMockDbConnection(); - - $schematicAssetTransformsService = new AssetTransforms(); - - $import = $schematicAssetTransformsService->import($assetTransformDefinitions, true); - - $this->assertInstanceOf(Result::class, $import); - $this->assertFalse($import->hasErrors()); - } + /** + * @covers ::import + * @dataProvider provideValidAssetTransformDefinitions + * + * @param array $assetTransformDefinitions + */ + public function testImportWithForceOption(array $assetTransformDefinitions) + { + $this->setMockAssetTransformsService(); + $this->setMockDbConnection(); + + $schematicAssetTransformsService = new AssetTransforms(); + + $import = $schematicAssetTransformsService->import($assetTransformDefinitions, true); + + $this->assertInstanceOf(Result::class, $import); + $this->assertFalse($import->hasErrors()); + } //============================================================================================================== //============================================== PROVIDERS =================================================== diff --git a/tests/Services/CategoryGroupsTest.php b/tests/Services/CategoryGroupsTest.php index 7fed57fc..5337acd6 100644 --- a/tests/Services/CategoryGroupsTest.php +++ b/tests/Services/CategoryGroupsTest.php @@ -72,25 +72,25 @@ public function testSuccessfulImport(array $groupDefinitions) $this->assertFalse($import->hasErrors()); } - /** - * @covers ::import - * @dataProvider provideValidCategoryGroupDefinitions - * - * @param array $groupDefinitions - */ - public function testImportWithForceOption(array $groupDefinitions) - { - $this->setMockCategoriesService(); - $this->setMockDbConnection(); - $this->setMockSchematicFields(); - - $schematicCategoryGroupsService = new CategoryGroups(); - - $import = $schematicCategoryGroupsService->import($groupDefinitions, true); - - $this->assertInstanceOf(Result::class, $import); - $this->assertFalse($import->hasErrors()); - } + /** + * @covers ::import + * @dataProvider provideValidCategoryGroupDefinitions + * + * @param array $groupDefinitions + */ + public function testImportWithForceOption(array $groupDefinitions) + { + $this->setMockCategoriesService(); + $this->setMockDbConnection(); + $this->setMockSchematicFields(); + + $schematicCategoryGroupsService = new CategoryGroups(); + + $import = $schematicCategoryGroupsService->import($groupDefinitions, true); + + $this->assertInstanceOf(Result::class, $import); + $this->assertFalse($import->hasErrors()); + } //============================================================================================================== //============================================== PROVIDERS =================================================== diff --git a/tests/Services/ElementIndexSettingsTest.php b/tests/Services/ElementIndexSettingsTest.php index fb9b4be8..d1424e93 100644 --- a/tests/Services/ElementIndexSettingsTest.php +++ b/tests/Services/ElementIndexSettingsTest.php @@ -60,9 +60,6 @@ protected function getMockElementsService($getAllElementTypesResponse = []) /** * @return ElementIndexesService|Mock - * - * @param array $getSettingsResponse - * * @return Mock */ protected function getMockElementIndexesService() @@ -71,7 +68,7 @@ protected function getMockElementIndexesService() $mock = $this->getMockBuilder(ElementIndexesService::class)->getMock(); $mock->expects($this->any())->method('getSettings')->will($this->returnValueMap([ ['Entry', $getSettingsResponse['Entry']], - ['Category', $getSettingsResponse['Category']] + ['Category', $getSettingsResponse['Category']], ])); $mock->expects($this->any())->method('saveSettings')->willReturn(false); @@ -222,10 +219,10 @@ private function setMockSources() } /** - * @param string $fieldType - * @param string $source - * @param string $fromIndex - * @param string $toIndex + * @param string $fieldType + * @param string $source + * @param string $fromIndex + * @param string $toIndex * * @return string */ @@ -234,13 +231,10 @@ public function getMockSourceCallback($fieldType, $source, $fromIndex, $toIndex) switch ($source) { case 'field:handle': return 'field:1'; - break; case 'field:1': return 'field:handle'; - break; default: return $source; - break; } } diff --git a/tests/Services/TagGroupsTest.php b/tests/Services/TagGroupsTest.php index 362f9d9b..17f0b48f 100644 --- a/tests/Services/TagGroupsTest.php +++ b/tests/Services/TagGroupsTest.php @@ -71,25 +71,25 @@ public function testSuccessfulImport(array $groupDefinitions) $this->assertFalse($import->hasErrors()); } - /** - * @covers ::import - * @dataProvider provideValidTagGroupDefinitions - * - * @param array $groupDefinitions - */ - public function testImportWithForceOption(array $groupDefinitions) - { - $this->setMockTagsService(); - $this->setMockDbConnection(); - $this->setMockSchematicFields(); - - $schematicUserGroupsService = new TagGroups(); - - $import = $schematicUserGroupsService->import($groupDefinitions, true); - - $this->assertInstanceOf(Result::class, $import); - $this->assertFalse($import->hasErrors()); - } + /** + * @covers ::import + * @dataProvider provideValidTagGroupDefinitions + * + * @param array $groupDefinitions + */ + public function testImportWithForceOption(array $groupDefinitions) + { + $this->setMockTagsService(); + $this->setMockDbConnection(); + $this->setMockSchematicFields(); + + $schematicUserGroupsService = new TagGroups(); + + $import = $schematicUserGroupsService->import($groupDefinitions, true); + + $this->assertInstanceOf(Result::class, $import); + $this->assertFalse($import->hasErrors()); + } //============================================================================================================== //============================================== PROVIDERS ===================================================