Skip to content

Commit

Permalink
Merge pull request #96 from nerds-and-company/fixes
Browse files Browse the repository at this point in the history
Renamed package, added info about schematic-commerce and small fixes
  • Loading branch information
Bob Olde Hampsink authored Apr 19, 2017
2 parents be7ccc3 + ee164ef commit 5b16e99
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 120 deletions.
71 changes: 38 additions & 33 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "itmundi/schematic",
"name": "nerds-and-company/schematic",
"description": "Craft setup and sync tool",
"authors": [
{
Expand Down
38 changes: 19 additions & 19 deletions tests/Services/AssetSourcesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===================================================
Expand Down
36 changes: 18 additions & 18 deletions tests/Services/AssetTransformsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===================================================
Expand Down
38 changes: 19 additions & 19 deletions tests/Services/CategoryGroupsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===================================================
Expand Down
16 changes: 5 additions & 11 deletions tests/Services/ElementIndexSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ protected function getMockElementsService($getAllElementTypesResponse = [])

/**
* @return ElementIndexesService|Mock
*
* @param array $getSettingsResponse
*
* @return Mock
*/
protected function getMockElementIndexesService()
Expand All @@ -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);

Expand Down Expand Up @@ -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
*/
Expand All @@ -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;
}
}

Expand Down
Loading

0 comments on commit 5b16e99

Please sign in to comment.