mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-02-28 02:59:40 +00:00
Apply new rector rules regarding to PHP version to 8.4
This commit is contained in:
@@ -42,8 +42,8 @@ class GeneratorTest extends TestCase
|
||||
{
|
||||
$templateStoredObject = new StoredObject();
|
||||
$templateStoredObject->registerVersion(type: 'application/test');
|
||||
$template = (new DocGeneratorTemplate())->setFile($templateStoredObject);
|
||||
$destinationStoredObject = (new StoredObject())->setStatus(StoredObject::STATUS_PENDING);
|
||||
$template = new DocGeneratorTemplate()->setFile($templateStoredObject);
|
||||
$destinationStoredObject = new StoredObject()->setStatus(StoredObject::STATUS_PENDING);
|
||||
$reflection = new \ReflectionClass($destinationStoredObject);
|
||||
$reflection->getProperty('id')->setValue($destinationStoredObject, 1);
|
||||
$entity = new class () {};
|
||||
@@ -117,8 +117,8 @@ class GeneratorTest extends TestCase
|
||||
|
||||
$templateStoredObject = new StoredObject();
|
||||
$templateStoredObject->registerVersion(type: 'application/test');
|
||||
$template = (new DocGeneratorTemplate())->setFile($templateStoredObject);
|
||||
$destinationStoredObject = (new StoredObject())->setStatus(StoredObject::STATUS_READY);
|
||||
$template = new DocGeneratorTemplate()->setFile($templateStoredObject);
|
||||
$destinationStoredObject = new StoredObject()->setStatus(StoredObject::STATUS_READY);
|
||||
|
||||
$generator->generateDocFromTemplate(
|
||||
$template,
|
||||
@@ -135,8 +135,8 @@ class GeneratorTest extends TestCase
|
||||
|
||||
$templateStoredObject = new StoredObject();
|
||||
$templateStoredObject->registerVersion(type: 'application/test');
|
||||
$template = (new DocGeneratorTemplate())->setFile($templateStoredObject);
|
||||
$destinationStoredObject = (new StoredObject())->setStatus(StoredObject::STATUS_PENDING);
|
||||
$template = new DocGeneratorTemplate()->setFile($templateStoredObject);
|
||||
$destinationStoredObject = new StoredObject()->setStatus(StoredObject::STATUS_PENDING);
|
||||
$reflection = new \ReflectionClass($destinationStoredObject);
|
||||
$reflection->getProperty('id')->setValue($destinationStoredObject, 1);
|
||||
|
||||
|
||||
@@ -62,19 +62,16 @@ class OnAfterMessageHandledClearStoredObjectCacheTest extends TestCase
|
||||
|
||||
$class = new \ReflectionClass($creator);
|
||||
$property = $class->getProperty('id');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($creator, 1);
|
||||
|
||||
$template ??= new DocGeneratorTemplate();
|
||||
$class = new \ReflectionClass($template);
|
||||
$property = $class->getProperty('id');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($template, 2);
|
||||
|
||||
$destinationStoredObject = new StoredObject();
|
||||
$class = new \ReflectionClass($destinationStoredObject);
|
||||
$property = $class->getProperty('id');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($destinationStoredObject, 3);
|
||||
|
||||
return new RequestGenerationMessage(
|
||||
|
||||
@@ -115,14 +115,7 @@ class OnGenerationFailsTest extends TestCase
|
||||
if (!$arg instanceof Email) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($arg->getTo() as $to) {
|
||||
if ('test@test.com' === $to->getAddress()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return array_any($arg->getTo(), fn($to) => 'test@test.com' === $to->getAddress());
|
||||
}),
|
||||
Argument::any()
|
||||
)
|
||||
@@ -155,19 +148,16 @@ class OnGenerationFailsTest extends TestCase
|
||||
if (null === $creator->getId()) {
|
||||
$class = new \ReflectionClass($creator);
|
||||
$property = $class->getProperty('id');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($creator, 1);
|
||||
}
|
||||
|
||||
$template ??= new DocGeneratorTemplate();
|
||||
$class = new \ReflectionClass($template);
|
||||
$property = $class->getProperty('id');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($template, 2);
|
||||
|
||||
$class = new \ReflectionClass($destinationStoredObject);
|
||||
$property = $class->getProperty('id');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($destinationStoredObject, 3);
|
||||
|
||||
return new RequestGenerationMessage(
|
||||
|
||||
Reference in New Issue
Block a user