Skip to content

Commit

Permalink
TASK: Lotta adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Nov 19, 2024
1 parent eaefd33 commit 50a680f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"lint:phpcs": "../../bin/phpcs --colors",
"lint:phpcs:fix": "../../bin/phpcbf --colors",
"lint:phpstan": "../../bin/phpstan analyse",
"lint:phpstan": "../../bin/phpstan analyse -v",
"lint:phpstan-generate-baseline": "../../bin/phpstan analyse --generate-baseline",
"lint:distributionintegrity": "[ -d 'Neos.ContentRepository' ] && { echo 'Package Neos.ContentRepository should not exist.' 1>&2; exit 1; } || exit 0;",
"lint": [
Expand All @@ -27,7 +27,7 @@
],
"test:paratest-cli": "../../bin/paratest --debug -v --functional --processes 2 --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml",
"test:parallel": [
"for f in Neos.ContentRepository.BehavioralTests/Tests/Parallel/**/*Test.php; do composer test:paratest-cli $f; done"
"for f in Neos.ContentRepository.BehavioralTests/Tests/Parallel/**/*Test.php; do composer test:paratest-cli $f || exit 1; done"
],
"test:behat-cli": "../../bin/behat -f progress --strict --no-interaction",
"test:behavioral": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@
namespace Neos\ContentRepository\BehavioralTests\Tests\Parallel\WorkspacePublicationDuringWriting;

use Neos\ContentRepository\BehavioralTests\Tests\Parallel\AbstractParallelTestCase;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinPyStringNodeBasedNodeTypeManagerFactory;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinTableNodeBasedContentDimensionSourceFactory;
use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\Dimension\ContentDimension;
use Neos\ContentRepository\Core\Dimension\ContentDimensionId;
use Neos\ContentRepository\Core\Dimension\ContentDimensionSourceInterface;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint;
use Neos\ContentRepository\Core\Feature\NodeCreation\Command\CreateNodeAggregateWithNode;
Expand All @@ -30,14 +25,15 @@
use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateRootWorkspace;
use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateWorkspace;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\PublishWorkspace;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\NodeType\NodeTypeName;
use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Exception\ContentStreamIsClosed;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\ContentRepository\TestSuite\Fakes\FakeContentDimensionSourceFactory;
use Neos\ContentRepository\TestSuite\Fakes\FakeNodeTypeManagerFactory;
use Neos\EventStore\Exception\ConcurrencyException;
use Neos\Flow\ObjectManagement\ObjectManagerInterface;
use PHPUnit\Framework\Assert;
Expand All @@ -55,31 +51,17 @@ public function setUp(): void
{
parent::setUp();
$this->log('------ process started ------');
// todo refrain from Gherkin naming here and make fakes easier to use: https://github.com/neos/neos-development-collection/pull/5346
GherkinTableNodeBasedContentDimensionSourceFactory::$contentDimensionsToUse = new class implements ContentDimensionSourceInterface
{
public function getDimension(ContentDimensionId $dimensionId): ?ContentDimension
{
return null;
}
public function getContentDimensionsOrderedByPriority(): array
{
return [];
}
};
// todo refrain from Gherkin naming here and make fakes easier to use: https://github.com/neos/neos-development-collection/pull/5346
GherkinPyStringNodeBasedNodeTypeManagerFactory::$nodeTypesToUse = new NodeTypeManager(
fn (): array => [
'Neos.ContentRepository:Root' => [],
'Neos.ContentRepository.Testing:Document' => [
'properties' => [
'title' => [
'type' => 'string'
]
FakeContentDimensionSourceFactory::setWithoutDimensions();
FakeNodeTypeManagerFactory::setConfiguration([
'Neos.ContentRepository:Root' => [],
'Neos.ContentRepository.Testing:Document' => [
'properties' => [
'title' => [
'type' => 'string'
]
]
]
);
]);

$setupLockResource = fopen(self::SETUP_LOCK_PATH, 'w+');

Expand Down
2 changes: 1 addition & 1 deletion Neos.ContentRepository.Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"phpstan/phpstan": "^1.5",
"phpstan/phpstan": "^1.11",
"squizlabs/php_codesniffer": "^3.6",
"phpunit/phpunit": "^9.0"
},
Expand Down
2 changes: 1 addition & 1 deletion Neos.ContentRepository.Export/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"phpstan/phpstan": "^1.8"
"phpstan/phpstan": "^1.11"
},
"suggest": {
"league/flysystem-ziparchive": "to export zip archives",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,6 @@ public function iRunTheSiteMigration(): void

/** ---------------------------------- */

/**
* @param TableNode $table
* @return array
* @throws JsonException
*/
private function parseJsonTable(TableNode $table): array
{
return array_map(static function (array $row) {
return array_map(static function (string $jsonValue) {
return json_decode($jsonValue, true, 512, JSON_THROW_ON_ERROR);
}, $row);
}, $table->getHash());
}

protected function getContentRepositoryService(
ContentRepositoryServiceFactoryInterface $factory
): ContentRepositoryServiceInterface {
Expand Down
11 changes: 1 addition & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
],
"test:paratest-cli": "../../bin/paratest --debug -v --functional --processes 2 --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml",
"test:parallel": [
"for f in Neos.ContentRepository.BehavioralTests/Tests/Parallel/**/*Test.php; do composer test:paratest-cli $f; done"
"for f in Neos.ContentRepository.BehavioralTests/Tests/Parallel/**/*Test.php; do composer test:paratest-cli $f || exit 1; done"
],
"test:behat-cli": "../../bin/behat -f progress --strict --no-interaction",
"test:behavioral": [
Expand Down Expand Up @@ -297,14 +297,5 @@
"phpunit/phpunit": "^9.0",
"neos/behat": "*",
"league/flysystem-memory": "^3"
},

"config": {
"_comment": "We need to insert a vendor dir (even though composer install MUST NOT be run here) but so autoloading works for composer scripts",
"vendor-dir": "../Libraries",
"allow-plugins": {
"neos/composer-plugin": false,
"cweagans/composer-patches": false
}
}
}

0 comments on commit 50a680f

Please sign in to comment.