Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-28527: Fix ContentTypeFormProcessorTest::testAddFieldDefinition test #190

Merged
merged 1 commit into from
Dec 14, 2017
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
*/
namespace EzSystems\RepositoryForms\Tests\Form\Processor;

use eZ\Publish\API\Repository\ContentTypeService;
use eZ\Publish\API\Repository\Values\ContentType\FieldDefinitionCreateStruct;
use eZ\Publish\Core\Helper\FieldsGroups\FieldsGroupsList;
use eZ\Publish\Core\Repository\Values\ContentType\ContentType;
use eZ\Publish\API\Repository\ContentTypeService;
use eZ\Publish\Core\Repository\Values\ContentType\ContentTypeDraft;
use eZ\Publish\Core\Repository\Values\ContentType\FieldDefinition;
use eZ\Publish\Core\Helper\FieldsGroups\FieldsGroupsList;
use EzSystems\RepositoryForms\Data\ContentTypeData;
use EzSystems\RepositoryForms\Data\FieldDefinitionData;
use EzSystems\RepositoryForms\Event\FormActionEvent;
use EzSystems\RepositoryForms\Event\RepositoryFormEvents;
use EzSystems\RepositoryForms\Form\Processor\ContentTypeFormProcessor;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Form\FormInterface;

class ContentTypeFormProcessorTest extends TestCase
{
Expand Down Expand Up @@ -100,17 +100,23 @@ public function testProcessDefaultAction()

public function testAddFieldDefinition()
{
$fieldTypeIdentifier = 'ezstring';
$languageCode = 'fre-FR';
$existingFieldDefinitions = [
new FieldDefinition(),
new FieldDefinition(),
new FieldDefinition([
'fieldTypeIdentifier' => $fieldTypeIdentifier,
'identifier' => sprintf('new_%s_%d', $fieldTypeIdentifier, 1),
]),
new FieldDefinition([
'fieldTypeIdentifier' => $fieldTypeIdentifier,
'identifier' => sprintf('new_%s_%d', $fieldTypeIdentifier, 2),
]),
];
$contentTypeDraft = new ContentTypeDraft([
'innerContentType' => new ContentType([
'fieldDefinitions' => $existingFieldDefinitions,
]),
]);
$fieldTypeIdentifier = 'ezstring';
$expectedNewFieldDefIdentifier = sprintf(
'new_%s_%d',
$fieldTypeIdentifier,
Expand Down