-
Notifications
You must be signed in to change notification settings - Fork 30
IBX-7579:Richtext: Rows are added to ezurl_object_link on every save #402
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
Open
vidarl
wants to merge
6
commits into
1.3
Choose a base branch
from
ibx-7579_rows_are_added_to_ezurl_object_link_on_every_save_by_richtext
base: 1.3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+91
−0
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
54e2918
IBX-7579:Richtext: Rows are added to ezurl_object_link on every save
vidarl 1c1c742
fixup! IBX-7579:Richtext: Rows are added to ezurl_object_link on ever…
vidarl 26e6145
fixup! fixup! IBX-7579:Richtext: Rows are added to ezurl_object_link …
vidarl c6c0c22
fixup! fixup! IBX-7579:Richtext: Rows are added to ezurl_object_link …
vidarl f21a80e
fixup! fixup! fixup! IBX-7579:Richtext: Rows are added to ezurl_objec…
vidarl 52df597
fixup! fixup! fixup! fixup! IBX-7579:Richtext: Rows are added to ezur…
vidarl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
eZ/Publish/Core/FieldType/Tests/Integration/Url/UrlStorage/UrlStorageGatewayTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
| * @license For full copyright and license information view LICENSE file distributed with this source code. | ||
| */ | ||
| namespace eZ\Publish\Core\FieldType\Tests\Integration\Url\UrlStorage; | ||
|
|
||
| use eZ\Publish\Core\FieldType\Tests\Integration\BaseCoreFieldTypeIntegrationTest; | ||
| use eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway; | ||
|
|
||
| /** | ||
| * Url Field Type external storage gateway tests. | ||
| */ | ||
| abstract class UrlStorageGatewayTest extends BaseCoreFieldTypeIntegrationTest | ||
| { | ||
| abstract protected function getGateway(): Gateway; | ||
|
|
||
| /** | ||
| * @covers \eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\DoctrineStorage::getUrlsFromUrlLink | ||
| */ | ||
|
vidarl marked this conversation as resolved.
Outdated
|
||
| public function testGetUrlsFromUrlLink() | ||
|
vidarl marked this conversation as resolved.
Outdated
|
||
| { | ||
| $gateway = $this->getGateway(); | ||
|
|
||
| $urlIds = []; | ||
| $urlIds[] = $gateway->insertUrl('https://ibexa.co/example1'); | ||
| $urlIds[] = $gateway->insertUrl('https://ibexa.co/example2'); | ||
| $urlIds[] = $gateway->insertUrl('https://ibexa.co/example3'); | ||
|
|
||
| $gateway->linkUrl($urlIds[0], 10, 1); | ||
| $gateway->linkUrl($urlIds[1], 10, 1); | ||
| $gateway->linkUrl($urlIds[1], 12, 2); | ||
| $gateway->linkUrl($urlIds[2], 14, 1); | ||
|
|
||
| self::assertEquals(['https://ibexa.co/example1' => true, 'https://ibexa.co/example2' => true], $gateway->getUrlsFromUrlLink(10, 1), 'Did not get expected urlS for field 10'); | ||
| self::assertEquals(['https://ibexa.co/example2' => true], $gateway->getUrlsFromUrlLink(12, 2), 'Did not get expected url for field 12'); | ||
| self::assertEquals(['https://ibexa.co/example3' => true], $gateway->getUrlsFromUrlLink(14, 1), 'Did not get expected url for field 14'); | ||
| self::assertEquals([], $gateway->getUrlsFromUrlLink(15, 1), 'Expected no urls for field 15'); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tests/integration/Core/FieldType/Url/UrlStorage/Gateway/UrlDoctrineStorageGatewayTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
| * @license For full copyright and license information view LICENSE file distributed with this source code. | ||
| */ | ||
| declare(strict_types=1); | ||
|
|
||
| namespace Ibexa\Tests\integration\Core\FieldType\Url\UrlStorage\Gateway; | ||
|
vidarl marked this conversation as resolved.
Outdated
|
||
|
|
||
| use eZ\Publish\Core\FieldType\Tests\Integration\Url\UrlStorage\UrlStorageGatewayTest; | ||
| use eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway as UrlStorageGateway; | ||
| use eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\DoctrineStorage; | ||
|
|
||
| final class UrlDoctrineStorageGatewayTest extends UrlStorageGatewayTest | ||
| { | ||
| protected function getGateway(): UrlStorageGateway | ||
| { | ||
| return new DoctrineStorage($this->getDatabaseConnection()); | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.