-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! IBX-7579:Richtext: Rows are added to ezurl_object_link on ever…
…y save: Changed unit test into integration test
- Loading branch information
Showing
3 changed files
with
64 additions
and
24 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
eZ/Publish/Core/FieldType/Tests/Integration/Url/UrlStorage/UrlStorageGatewayTest.php
This file contains 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,42 @@ | ||
<?php | ||
Check warning on line 1 in eZ/Publish/Core/FieldType/Tests/Integration/Url/UrlStorage/UrlStorageGatewayTest.php GitHub Actions / Run code style check (8.0)
Check warning on line 1 in eZ/Publish/Core/FieldType/Tests/Integration/Url/UrlStorage/UrlStorageGatewayTest.php GitHub Actions / Run code style check (8.0)
Check warning on line 1 in eZ/Publish/Core/FieldType/Tests/Integration/Url/UrlStorage/UrlStorageGatewayTest.php GitHub Actions / Run code style check (8.0)
|
||
|
||
/** | ||
* @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 | ||
*/ | ||
public function testGetUrlsFromUrlLink() | ||
{ | ||
self::assertEquals(true, false, "force failure"); | ||
$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 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 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; | ||
|
||
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()); | ||
} | ||
} |