Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/9.0' into nodeTypeFallbackHandling
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Sep 29, 2023
2 parents f02344c + 4de3469 commit 4cdbd52
Show file tree
Hide file tree
Showing 74 changed files with 342 additions and 39,359 deletions.
14 changes: 8 additions & 6 deletions .composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "neos-package-collection",
"require": {
"neos/flow-development-collection": "9.0.x-dev",
"neos/neos-setup": "^2.0"
"neos/neos-setup": "^2.0",
"league/flysystem-memory": "^3"
},
"replace": {
},
Expand All @@ -17,9 +18,11 @@
"@lint:phpcs-psr12 --exclude=Generic.Files.LineLength,PSR1.Files.SideEffects"
],
"lint:phpstan": "../../bin/phpstan analyse",
"lint:distributionintegrity": "[ -d 'Neos.ContentRepository' ] && { echo 'Package Neos.ContentRepository should not exist.' 1>&2; exit 1; } || exit 0;",
"lint": [
"@lint:phpcs",
"@lint:phpstan"
"@lint:phpstan",
"@lint:distributionintegrity"
],
"test:unit": [
"../../bin/phpunit --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/UnitTests.xml Neos.ContentRepository.Core/Tests/Unit",
Expand All @@ -29,18 +32,17 @@
"../../bin/phpunit --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.Core/Tests/Functional"
],
"test:behavioral": [
"mkdir -p ../../Build/Behat/; cp -R Neos.ContentRepository.BehavioralTests/DistributionBehatTemplate/* ../../Build/Behat/; cd ../../Build/Behat/; composer install; cd ../../Packages/Neos",
"../../bin/behat -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist",
"../../bin/behat -f progress -c Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser"
"../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml"
],
"test:behavioral:stop-on-failure": [
"mkdir -p ../../Build/Behat/; cp -R Neos.ContentRepository.BehavioralTests/DistributionBehatTemplate/* ../../Build/Behat/; cd ../../Build/Behat/; composer install; cd ../../Packages/Neos",
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist",
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser"
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.Neos/Tests/Behavior/behat.yml",
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist"
],
"test": [
"@test:unit",
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
git -C ../${{ env.NEOS_FOLDER }} checkout -b build
composer config repositories.neos '{ "type": "path", "url": "../${{ env.NEOS_FOLDER }}", "options": { "symlink": false } }'
composer require --no-update neos/neos-development-collection:"dev-build as ${{ env.NEOS_BRANCH_ALIAS }}"
# workaround for not-yet-released neos/eventstore packages
# TODO workaround for not-yet-released neos/eventstore packages
composer require --no-update neos/eventstore:"dev-main"
composer require --no-update neos/eventstore-doctrineadapter:"dev-main"
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
FLOW_CONTEXT=Testing ./flow doctrine:migrate --quiet
bin/phpunit --colors --stop-on-failure -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml --testsuite "Neos tests" --verbose
- name: Run ES CR Tests
- name: Run Behavioral Tests (ES CR && Neos.Neos)
id: escrtests
if: matrix.parallel-parts == 'escr-behavioral'
# DEBUG MODE: comment-in the next line, because we want to reach the Upload Mysql/Postgres DB dump step.
Expand Down Expand Up @@ -325,18 +325,6 @@ jobs:
if: matrix.parallel-parts == 'functionaltests-postgres'
run: bin/phpunit --colors --stop-on-failure -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml --testsuite "Neos tests" --verbose

- name: Run behat tests (PGSQL)
if: matrix.parallel-parts == 'functionaltests-postgres'
run: |
FLOW_CONTEXT=Testing/Behat ./flow configuration:show
FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationstatus
FLOW_CONTEXT=Testing/Behat ./flow behat:setup
FLOW_CONTEXT=Testing/Behat ./flow doctrine:create
FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationversion --add --version all
# TODO: RE-ENABLE AFTER FIXING
#bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser
buildall:
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip travis]')"
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postgresql-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@ jobs:
FLOW_CONTEXT=Testing/Behat ./flow behat:setup
FLOW_CONTEXT=Testing/Behat ./flow doctrine:create
FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationversion --add --version all
bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser
bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml
bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.ContentRepository/Tests/Behavior/behat.yml.dist
26 changes: 26 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
tools:
python: "3.9"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: Neos.Neos/Documentation/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf
- epub

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: Neos.Neos/Documentation/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
*/

require_once(__DIR__ . '/../../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php');
require_once(__DIR__ . '/../../../../../../Framework/Neos.Flow/Tests/Behavior/Features/Bootstrap/IsolatedBehatStepsTrait.php');
require_once(__DIR__ . '/../../../../../Neos.ContentRepository.Security/Tests/Behavior/Features/Bootstrap/NodeAuthorizationTrait.php');
require_once(__DIR__ . '/ProjectionIntegrityViolationDetectionTrait.php');

use Behat\Behat\Context\Context as BehatContext;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Neos\Behat\Tests\Behat\FlowContextTrait;
use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait;
use Neos\ContentRepository\BehavioralTests\Tests\Functional\BehatTestHelper;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\CRBehavioralTestsSubjectProvider;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinPyStringNodeBasedNodeTypeManagerFactory;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinTableNodeBasedContentDimensionSourceFactory;
Expand All @@ -30,21 +27,17 @@
use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceInterface;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteTrait;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Tests\Behavior\Features\Bootstrap\IsolatedBehatStepsTrait;

/**
* Features context
*/
class FeatureContext implements BehatContext
{
use FlowContextTrait;
use IsolatedBehatStepsTrait;
use ProjectionIntegrityViolationDetectionTrait;
use CRTestSuiteTrait;
use CRBehavioralTestsSubjectProvider;

protected string $behatTestHelperObjectName = BehatTestHelper::class;

protected ContentRepositoryRegistry $contentRepositoryRegistry;

public function __construct()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@
*/

require_once(__DIR__ . '/../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php');
require_once(__DIR__ . '/../../../../Neos.ContentRepository.Security/Tests/Behavior/Features/Bootstrap/NodeAuthorizationTrait.php');
require_once(__DIR__ . '/../../../../Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php');
require_once(__DIR__ . '/../../../../../Framework/Neos.Flow/Tests/Behavior/Features/Bootstrap/IsolatedBehatStepsTrait.php');
require_once(__DIR__ . '/../../../../../Framework/Neos.Flow/Tests/Behavior/Features/Bootstrap/SecurityOperationsTrait.php');

use Behat\Behat\Context\Context as BehatContext;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use GuzzleHttp\Psr7\Uri;
use Neos\Behat\Tests\Behat\FlowContextTrait;
use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait;
use Neos\ContentRepository\BehavioralTests\ProjectionRaceConditionTester\Dto\TraceEntryType;
use Neos\ContentRepository\BehavioralTests\ProjectionRaceConditionTester\RedisInterleavingLogger;
use Neos\ContentRepository\BehavioralTests\Tests\Functional\BehatTestHelper;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\CRBehavioralTestsSubjectProvider;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinPyStringNodeBasedNodeTypeManagerFactory;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinTableNodeBasedContentDimensionSourceFactory;
Expand All @@ -33,37 +30,28 @@
use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceInterface;
use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite;
use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteTrait;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\MigrationsTrait;
use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\StructureAdjustmentsTrait;
use Neos\ContentRepository\Core\Tests\Behavior\Fixtures\DayOfWeek;
use Neos\ContentRepository\Core\Tests\Behavior\Fixtures\PostalAddress;
use Neos\ContentRepository\Core\Tests\Behavior\Fixtures\PriceSpecification;
use Neos\ContentRepository\Security\Service\AuthorizationService;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteTrait;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\MigrationsTrait;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\StructureAdjustmentsTrait;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Configuration\ConfigurationManager;
use Neos\Flow\ObjectManagement\ObjectManagerInterface;
use Neos\Flow\Tests\Behavior\Features\Bootstrap\IsolatedBehatStepsTrait;
use Neos\Flow\Tests\Behavior\Features\Bootstrap\SecurityOperationsTrait;

/**
* Features context
*/
class FeatureContext implements BehatContext
{
use FlowContextTrait;
use NodeAuthorizationTrait;
use SecurityOperationsTrait;
use IsolatedBehatStepsTrait;
use CRTestSuiteTrait;
use CRBehavioralTestsSubjectProvider;
use ProjectionIntegrityViolationDetectionTrait;
use StructureAdjustmentsTrait;
use MigrationsTrait;

protected string $behatTestHelperObjectName = BehatTestHelper::class;

protected ContentRepositoryRegistry $contentRepositoryRegistry;

private bool $raceConditionTrackerEnabled = false;
Expand All @@ -75,8 +63,6 @@ public function __construct()
}
$this->objectManager = self::$bootstrap->getObjectManager();

$this->setupSecurity();
$this->nodeAuthorizationService = $this->getObjectManager()->get(AuthorizationService::class);
$this->dbalClient = $this->getObjectManager()->get(DbalClientInterface::class);
$this->setupCRTestSuiteTrait();
$this->setUpInterleavingLogger();
Expand Down

This file was deleted.

21 changes: 8 additions & 13 deletions Neos.ContentRepository.Core/Classes/NodeType/NodeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,19 @@ public function isAggregate(): bool
* @return boolean true if this node type is of the given kind, otherwise false
* @api
*/
public function isOfType(string $nodeType): bool
public function isOfType(string|NodeTypeName $nodeTypeName): bool
{
if ($nodeType === $this->name->value) {
if (!is_string($nodeTypeName)) {
$nodeTypeName = $nodeTypeName->value;
}
if ($nodeTypeName === $this->name->value) {
return true;
}
if (array_key_exists($nodeType, $this->declaredSuperTypes) && $this->declaredSuperTypes[$nodeType] === null) {
if (array_key_exists($nodeTypeName, $this->declaredSuperTypes) && $this->declaredSuperTypes[$nodeTypeName] === null) {
return false;
}
foreach ($this->declaredSuperTypes as $superType) {
if ($superType !== null && $superType->isOfType($nodeType) === true) {
if ($superType !== null && $superType->isOfType($nodeTypeName) === true) {
return true;
}
}
Expand Down Expand Up @@ -407,15 +410,7 @@ public function getProperties(): array
public function getPropertyType(string $propertyName): string
{
$this->initialize();

if (
!isset($this->fullConfiguration['properties'])
|| !isset($this->fullConfiguration['properties'][$propertyName])
|| !isset($this->fullConfiguration['properties'][$propertyName]['type'])
) {
return 'string';
}
return $this->fullConfiguration['properties'][$propertyName]['type'];
return $this->fullConfiguration['properties'][$propertyName]['type'] ?? 'string';
}

/**
Expand Down
Loading

0 comments on commit 4cdbd52

Please sign in to comment.