Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/Behat/RwDemosContextTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Atk4\Data\Model;
use Atk4\Data\Persistence;
use Doctrine\DBAL\Types\Type;

trait RwDemosContextTrait
{
Expand Down Expand Up @@ -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(),
]);
}
Expand Down
2 changes: 1 addition & 1 deletion tests-behat/card.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 6 additions & 1 deletion tests/DemosHttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Atk4\Ui\Callback;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\LazyOpenStream;
use Symfony\Component\Process\Process;

/**
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/DemosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down