diff --git a/composer.json b/composer.json index d568ae2c5f..df62ee2afe 100644 --- a/composer.json +++ b/composer.json @@ -84,6 +84,7 @@ "conflict": { "behat/behat": "<3.9", "behat/mink": "<1.9", + "guzzlehttp/psr7": "<2.4", "symfony/console": "<4.4.30 || >=5 <5.3.7", "symfony/css-selector": "<4.4.24 || >=5 <5.2.9", "symfony/filesystem": "<4.4.30 || >=5 <5.3.7", diff --git a/src/Behat/RwDemosContextTrait.php b/src/Behat/RwDemosContextTrait.php index e9a782092d..f020a518fe 100644 --- a/src/Behat/RwDemosContextTrait.php +++ b/src/Behat/RwDemosContextTrait.php @@ -6,6 +6,7 @@ use Atk4\Data\Model; use Atk4\Data\Persistence; +use Doctrine\DBAL\Types\Type; trait RwDemosContextTrait { @@ -57,7 +58,7 @@ protected function createDatabaseModelFromTable(string $table): Model $model->removeField('id'); foreach ($tableColumns as $tableColumn) { $model->addField($tableColumn->getName(), [ - 'type' => $tableColumn->getType()->getName(), // @phpstan-ignore-line Type::getName() is deprecated in DBAL 4.0 + 'type' => Type::getTypeRegistry()->lookupName($tableColumn->getType()), // TODO simplify once https://github.com/doctrine/dbal/pull/6130 is merged 'nullable' => !$tableColumn->getNotnull(), ]); } diff --git a/tests-behat/card.feature b/tests-behat/card.feature index 839d1b1320..88552ff173 100644 --- a/tests-behat/card.feature +++ b/tests-behat/card.feature @@ -18,7 +18,7 @@ Feature: Card When I press button "Delete" Then Modal is open with text "Please go ahead. Demo mode does not really delete data." When I press Modal button "Ok" - Then Modal is open with text "Atk4\Data\Exception: Calling user action on a Model with dirty fields that are not allowed by this action" + Then Modal is open with text "Atk4\Data\Exception: User action cannot be executed when unrelated fields are dirty" Scenario: Given I am on "interactive/card-action.php" diff --git a/tests/DemosHttpTest.php b/tests/DemosHttpTest.php index c8d48ea0b0..6a1da4dea4 100644 --- a/tests/DemosHttpTest.php +++ b/tests/DemosHttpTest.php @@ -6,6 +6,7 @@ use Atk4\Ui\Callback; use GuzzleHttp\Client; +use GuzzleHttp\Psr7\LazyOpenStream; use Symfony\Component\Process\Process; /** @@ -103,7 +104,11 @@ private function setupWebserver(): void protected function getClient(): Client { - return new Client(['base_uri' => 'http://localhost:' . $this->port]); + // never buffer the response thru disk, remove once streaming with curl is supported + // https://github.com/guzzle/guzzle/issues/3115 + $sink = new LazyOpenStream('php://memory', 'w+'); + + return new Client(['base_uri' => 'http://localhost:' . $this->port, 'sink' => $sink]); } protected function getPathWithAppVars(string $path): string diff --git a/tests/DemosTest.php b/tests/DemosTest.php index bc783de448..f3fac54d99 100644 --- a/tests/DemosTest.php +++ b/tests/DemosTest.php @@ -346,7 +346,7 @@ public function testDemoGet(string $path): void public function testHugeOutputStream(): void { - $sizeMb = 50; + $sizeMb = 40; $sizeBytes = $sizeMb * 1024 * 1024; $response = $this->getResponseFromRequest('_unit-test/stream.php?size_mb=' . $sizeMb); self::assertSame(200, $response->getStatusCode());