Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
php-versions: ['8.2', '8.3']
flow-versions: ['8.0', '8.3', '9.0']
flow-versions: ['8.4', '9.0']
dependencies: ['highest']

defaults:
Expand All @@ -29,14 +29,14 @@ jobs:

steps:
- name: Checkout Flow development distribution
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: neos/flow-development-distribution
ref: ${{ matrix.flow-versions }}
path: ${{ env.FLOW_FOLDER }}

- name: Checkout package
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: ${{ env.PACKAGE_FOLDER}}/${{ env.PACKAGE_NAME }}

Expand Down
5 changes: 2 additions & 3 deletions Tests/Functional/AbstractFunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use PHPUnit\Framework\Attributes\Large;
use Neos\Flow\Http\Client\Browser;
use Neos\Flow\Mvc\Routing\Route;
use Neos\Flow\Tests\FunctionalTestCase;
Expand All @@ -21,9 +21,8 @@

/**
* Testcase for Simple Form
*
* @group large
*/
#[Large]
abstract class AbstractFunctionalTestCase extends FunctionalTestCase
{
/**
Expand Down
10 changes: 4 additions & 6 deletions Tests/Functional/FormBuildingFinishedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use PHPUnit\Framework\Attributes\Large;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\Assert;

/**
* Testcase for onBuildingFinished
*
* @group large
*/
#[Large]
class FormBuildingFinishedTest extends AbstractFunctionalTestCase
{
/**
* @test
*/
#[Test]
public function aFormElementCanAddNewSubelementsWithValidationApplied()
{
$this->browser->request('http://localhost/test/form/simpleform/TestingFormBuildingFinished');
Expand Down
27 changes: 9 additions & 18 deletions Tests/Functional/SimpleFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,21 @@
* information, please view the LICENSE file which was distributed with this
* source code.
*/
use PHPUnit\Framework\Attributes\Large;
use PHPUnit\Framework\Attributes\Test;
use Neos\Utility\ObjectAccess;
use PHPUnit\Framework\Assert;
use Symfony\Component\DomCrawler\Field\InputFormField;

/**
* Testcase for Simple Form
*
* @group large
*/
#[Large]
class SimpleFormTest extends AbstractFunctionalTestCase
{
protected static $testablePersistenceEnabled = true;

/**
* @test
*/
#[Test]
public function goingForthAndBackStoresFormValuesOfFirstPage()
{
$this->browser->request('http://localhost/test/form/simpleform/ThreePageFormWithValidation');
Expand All @@ -41,9 +40,7 @@ public function goingForthAndBackStoresFormValuesOfFirstPage()
Assert::assertSame('My Text on the first page', $form['--three-page-form-with-validation']['text1-1']->getValue());
}

/**
* @test
*/
#[Test]
public function goingForthAndBackStoresFormValuesOfSecondPage()
{
$this->browser->request('http://localhost/test/form/simpleform/ThreePageFormWithValidation');
Expand All @@ -59,9 +56,7 @@ public function goingForthAndBackStoresFormValuesOfSecondPage()
Assert::assertSame('My Text on the second page', $form['--three-page-form-with-validation']['text2-1']->getValue());
}

/**
* @test
*/
#[Test]
public function goingForthAndBackStoresFormValuesOfSecondPageAndTriggersValidationOnlyWhenGoingForward()
{
$this->browser->request('http://localhost/test/form/simpleform/ThreePageFormWithValidation');
Expand All @@ -83,10 +78,7 @@ public function goingForthAndBackStoresFormValuesOfSecondPageAndTriggersValidati
Assert::assertSame('', $form['--three-page-form-with-validation']['text3-1']->getValue());
}

/**
* @test
* Thanks to Anian Weber for reporting that issue!
*/
#[Test]
public function validationIsNotSkippedForGetRequests()
{
$this->browser->request('http://localhost/test/form/simpleform/ThreePageFormWithValidation');
Expand All @@ -109,11 +101,11 @@ public function validationIsNotSkippedForGetRequests()
}

/**
* @test
* @see https://github.com/neos/form/issues/126
* @see https://github.com/neos/form/issues/135
* @see https://github.com/neos/form/issues/143
*/
#[Test]
public function formStateCanContainArbitraryObjects()
{
$this->browser->request('http://localhost/test/form/simpleform/TwoPageFormWithUpload');
Expand All @@ -136,9 +128,8 @@ public function formStateCanContainArbitraryObjects()
* that we do NOT send any of the parameters with the form; as we only want the form state to be applied.
*
* So, if the form state contains some values, we want to be sure these values are re-displayed.
*
* @test
*/
#[Test]
public function goingForthAndBackStoresFormValuesOfSecondPageEvenWhenSecondPageIsManuallyCalledAsGetRequest()
{
$this->markTestSkipped('This test is skipped because we no longer allow Form validators to be skipped, see https://github.com/neos/form/security/advisories/GHSA-m5vx-8chx-qvmm');
Expand Down
53 changes: 21 additions & 32 deletions Tests/Unit/Core/Model/AbstractFinisherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
* information, please view the LICENSE file which was distributed with this
* source code.
*/

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use Neos\Flow\Tests\UnitTestCase;
use Neos\Form\Core\Model\AbstractFinisher;
use Neos\Form\Core\Model\FinisherContext;
Expand All @@ -20,21 +23,19 @@

/**
* Test for AbstractFinisher
* @covers \Neos\Form\Core\Model\AbstractFinisher<extended>
* @covers \Neos\Form\Core\Model\FinisherContext<extended>
* @covers \Neos\Form\Core\Runtime\FormRuntime<extended>
* @covers \Neos\Form\Core\Runtime\FormState<extended>
*/
#[CoversClass(AbstractFinisher::class)]
#[CoversClass(FinisherContext::class)]
#[CoversClass(FormRuntime::class)]
#[CoversClass(FormState::class)]
class AbstractFinisherTest extends UnitTestCase
{
/**
* @var FormRuntime
*/
protected $formRuntime = null;

/**
* @test
*/
#[Test]
public function executeSetsFinisherContextAndCallsExecuteInternal()
{
$finisher = $this->getAbstractFinisher();
Expand All @@ -45,9 +46,7 @@ public function executeSetsFinisherContextAndCallsExecuteInternal()
Assert::assertSame($finisherContext, $finisher->_get('finisherContext'));
}

/**
* @test
*/
#[Test]
public function parseOptionReturnsPreviouslySetOption()
{
$finisher = $this->getAbstractFinisher();
Expand All @@ -58,9 +57,7 @@ public function parseOptionReturnsPreviouslySetOption()
Assert::assertSame('bar', $finisher->_call('parseOption', 'foo'));
}

/**
* @test
*/
#[Test]
public function parseOptionReturnsNumbersAndSimpleTypesWithoutModification()
{
$finisher = $this->getAbstractFinisher();
Expand All @@ -73,7 +70,7 @@ public function parseOptionReturnsNumbersAndSimpleTypesWithoutModification()
Assert::assertSame($obj, $finisher->_call('parseOption', 'baz'));
}

public function dataProviderForDefaultOptions()
public static function dataProviderForDefaultOptions()
{
$defaultOptions = [
'overridden1' => 'Overridden1Default',
Expand Down Expand Up @@ -117,10 +114,8 @@ public function dataProviderForDefaultOptions()
];
}

/**
* @dataProvider dataProviderForDefaultOptions
* @test
*/
#[DataProvider('dataProviderForDefaultOptions')]
#[Test]
public function parseOptionReturnsDefaultOptionIfNecessary($defaultOptions, $options, $optionKey, $expected)
{
$finisher = $this->getAbstractFinisher();
Expand All @@ -132,7 +127,7 @@ public function parseOptionReturnsDefaultOptionIfNecessary($defaultOptions, $opt
Assert::assertSame($expected, $finisher->_call('parseOption', $optionKey));
}

public function dataProviderForPlaceholderReplacement()
public static function dataProviderForPlaceholderReplacement()
{
$formValues = [
'foo' => 'My Value',
Expand All @@ -153,10 +148,8 @@ public function dataProviderForPlaceholderReplacement()
];
}

/**
* @dataProvider dataProviderForPlaceholderReplacement
* @test
*/
#[DataProvider('dataProviderForPlaceholderReplacement')]
#[Test]
public function placeholdersAreReplacedWithFormRuntimeValues($formValues, $optionValue, $expected)
{
$finisher = $this->getAbstractFinisher();
Expand All @@ -173,10 +166,8 @@ public function placeholdersAreReplacedWithFormRuntimeValues($formValues, $optio
Assert::assertSame($expected, $finisher->_call('parseOption', 'key1'));
}

/**
* @dataProvider dataProviderForPlaceholderReplacement
* @test
*/
#[DataProvider('dataProviderForPlaceholderReplacement')]
#[Test]
public function placeholdersInsideDefaultsReplacedWithFormRuntimeValues($formValues, $optionValue, $expected)
{
$finisher = $this->getAbstractFinisher();
Expand All @@ -193,9 +184,7 @@ public function placeholdersInsideDefaultsReplacedWithFormRuntimeValues($formVal
Assert::assertSame($expected, $finisher->_call('parseOption', 'key1'));
}

/**
* @test
*/
#[Test]
public function cancelCanBeSetOnFinisherContext()
{
$finisherContext = $this->getFinisherContext();
Expand All @@ -205,7 +194,7 @@ public function cancelCanBeSetOnFinisherContext()
}

/**
* @return AbstractFinisher|\PHPUnit\Framework\MockObject\MockObject
* @return AbstractFinisher|MockObject
*/
protected function getAbstractFinisher()
{
Expand Down
Loading
Loading