Skip to content

Commit 833a9e6

Browse files
authored
Merge pull request #118 from TavoNiievez/strict_types
Add strict types
2 parents d6c36a0 + ca02d4c commit 833a9e6

File tree

29 files changed

+92
-26
lines changed

29 files changed

+92
-26
lines changed

src/Codeception/Lib/Connector/Yii2.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
namespace Codeception\Lib\Connector;
36

47
use Codeception\Exception\ConfigurationException;
@@ -402,10 +405,11 @@ protected function encodeCookies(
402405
: $cookie->value;
403406
$value = $security->hashData(serialize($data), $validationKey);
404407
}
408+
$expires = is_int($cookie->expire) ? (string)$cookie->expire : null;
405409
$c = new Cookie(
406410
$cookie->name,
407411
$value,
408-
$cookie->expire,
412+
$expires,
409413
$cookie->path,
410414
$cookie->domain,
411415
$cookie->secure,

src/Codeception/Lib/Connector/Yii2/ConnectionWatcher.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
declare(strict_types=1);
34

45
namespace Codeception\Lib\Connector\Yii2;
56

src/Codeception/Lib/Connector/Yii2/FixturesStore.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
namespace Codeception\Lib\Connector\Yii2;
36

47
use yii\test\FixtureTrait;

src/Codeception/Lib/Connector/Yii2/Logger.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
namespace Codeception\Lib\Connector\Yii2;
36

47
use Codeception\Util\Debug;

src/Codeception/Lib/Connector/Yii2/TestMailer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
namespace Codeception\Lib\Connector\Yii2;
36

47
use yii\mail\BaseMailer;

src/Codeception/Lib/Connector/Yii2/TransactionForcer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
declare(strict_types=1);
34

45
namespace Codeception\Lib\Connector\Yii2;
56

src/Codeception/Module/Yii2.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
declare(strict_types=1);
4+
25
namespace Codeception\Module;
36

47
use Codeception\Exception\ConfigurationException;
@@ -735,7 +738,7 @@ public function seeEmailIsSent(?int $num = null): void
735738
$this->assertNotEmpty($this->grabSentEmails(), 'emails were sent');
736739
return;
737740
}
738-
$this->assertEquals($num, count($this->grabSentEmails()), 'number of sent emails is equal to ' . $num);
741+
$this->assertSame($num, count($this->grabSentEmails()), 'number of sent emails is equal to ' . $num);
739742
}
740743

741744
/**
@@ -757,7 +760,7 @@ public function dontSeeEmailIsSent(): void
757760
* <?php
758761
* $I->seeEmailIsSent();
759762
* $messages = $I->grabSentEmails();
760-
* $I->assertEquals('admin@site,com', $messages[0]->getTo());
763+
* $I->assertSame('admin@site,com', $messages[0]->getTo());
761764
* ```
762765
*
763766
* @part email
@@ -780,7 +783,7 @@ public function grabSentEmails(): array
780783
* <?php
781784
* $I->seeEmailIsSent();
782785
* $message = $I->grabLastSentEmail();
783-
* $I->assertEquals('admin@site,com', $message->getTo());
786+
* $I->assertSame('admin@site,com', $message->getTo());
784787
* ```
785788
* @part email
786789
*/

tests/cases/closeConnections/fixtures/EmptyFixture.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace tests\fixtures;
46

57
use yii\test\DbFixture;

tests/cases/closeConnections/functional/FixturesCest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace tests\closeConnections;
46

57
use Codeception\Example;
@@ -29,7 +31,7 @@ protected function numberProvider()
2931
*/
3032
public function NoConnections(FunctionalTester $I, Example $example)
3133
{
32-
$I->assertEquals(SqlliteHelper::connectionCount(), $example['count']);
34+
$I->assertSame(SqlliteHelper::connectionCount(), $example['count']);
3335
}
3436

3537
}

tests/cases/closeConnections/functional/FixturesInBeforeCest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace tests\closeConnections;
46

57
use Codeception\Example;
@@ -29,7 +31,7 @@ protected function numberProvider()
2931
*/
3032
public function NoConnections(FunctionalTester $I, Example $example)
3133
{
32-
$I->assertEquals(SqlliteHelper::connectionCount(), $example['count']);
34+
$I->assertSame(SqlliteHelper::connectionCount(), $example['count']);
3335
}
3436

3537
}

0 commit comments

Comments
 (0)