Skip to content

Commit

Permalink
Fix backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed Jun 20, 2024
1 parent 2b9e83f commit 8e28b06
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Tests/Application/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APP_ENV=test
DATABASE_URL=mysql://root:root@127.0.0.1:3306/sulu_article_test?serverVersion=5.7
DATABASE_URL=mysql://root:@127.0.0.1:3306/sulu_test?serverVersion=5.7
DATABASE_CHARSET=utf8mb4
DATABASE_COLLATE=utf8mb4_unicode_ci
ELASTICSEARCH_HOST=127.0.0.1:9200
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,35 @@
use Sulu\Component\DocumentManager\DocumentManagerInterface;
use Sulu\Component\HttpKernel\SuluKernel;
use Sulu\Component\Persistence\Repository\ORM\EntityRepository;
use Sulu\Component\PHPCR\SessionManager\SessionManager;

class ArticleReferenceProviderTest extends SuluTestCase
{
private ArticleReferenceProvider $articleReferenceProvider;
private DocumentManagerInterface $documentManager;
private SessionManager $sessionManager;
/**
* @var ArticleReferenceProvider
*/
private $articleReferenceProvider;

/**
* @var DocumentManagerInterface
*/
private $documentManager;

/**
* @var EntityRepository<Reference>
*/
private EntityRepository $referenceRepository;
private $referenceRepository;

public function setUp(): void
{
$this->purgeDatabase();
$this->initPhpcr();

if (!\interface_exists(ReferenceRefresherInterface::class)) {
return;
}

$this->articleReferenceProvider = $this->getContainer()->get('sulu_article.reference_provider');
$this->documentManager = $this->getContainer()->get('sulu_document_manager.document_manager');
$this->sessionManager = $this->getContainer()->get('sulu.phpcr.session');
$this->referenceRepository = $this->getContainer()->get('sulu.repository.reference');
}

Expand Down Expand Up @@ -97,7 +105,6 @@ public function testUpdateUnpublishedReferences(): void
// refresh services from new kernel
$this->articleReferenceProvider = $this->getContainer()->get('sulu_article.reference_provider');
$this->documentManager = $this->getContainer()->get('sulu_document_manager.document_manager');
$this->sessionManager = $this->getContainer()->get('sulu.phpcr.session');
$this->referenceRepository = $this->getContainer()->get('sulu.repository.reference');

/** @var ArticleDocument $article */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public function setUp(): void
if (!\interface_exists(ReferenceRefresherInterface::class)) {
return;
}

$this->articleReferenceRefresher = $this->getContainer()->get('sulu_article.article_reference_refresher');
$this->documentManager = $this->getContainer()->get('sulu_document_manager.document_manager');
$this->referenceRepository = $this->getContainer()->get('sulu.repository.reference');
Expand Down

0 comments on commit 8e28b06

Please sign in to comment.