Skip to content

Commit

Permalink
fix test & psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Feb 2, 2022
1 parent effbbd9 commit 8906eff
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Expand Up @@ -3,17 +3,16 @@
namespace Pushword\Conversation\Tests\Controller;

use Pushword\Conversation\Controller\ConversationFormController;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Panther\PantherTestCase;

class ConversationFormControllerTest extends KernelTestCase
class ConversationFormControllerTest extends PantherTestCase
{
public function testShowHomepage()
{
$request = Request::create('/testit?referring=test&type=ms-message');
$request->headers->set('origin', 'https://localhost.dev');
$response = $this->getController()->show($request, 'message', 'localhost.dev');
$this->assertSame(200, $response->getStatusCode());
$client = static::createClient();

$client->request('POST', '/conversation/message/test', [], [], ['HTTP_ORIGIN' => 'https://localhost.dev']);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
}

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/Utils/LastTime.php
Expand Up @@ -40,6 +40,9 @@ public function get(?string $default = null): ?\DateTimeInterface
return new DateTime('@'.\Safe\filemtime($this->filePath));
}

/**
* @psalm-suppress InvalidNullableReturnType
*/
public function safeGet(string $default): \DateTimeInterface
{
return $this->get($default); // @phpstan-ignore-line
Expand Down
Binary file modified packages/skeleton/var/app.db
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/static-generator/src/Generator/MediaGenerator.php
Expand Up @@ -28,7 +28,7 @@ protected function copyMediaToDownload(): void
}

$dir = dir($mediaDir);
if (\in_array($dir, [null, false], true)) {
if (false === $dir) {
return;
}

Expand Down

0 comments on commit 8906eff

Please sign in to comment.