-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
<?xml version="1.0" ?> | ||
<ruleset name="Project rules"> | ||
<file>src</file> | ||
<file>tests</file> | ||
<rule ref="vendor/pccomponentes/coding-standard/src/ruleset.xml"> | ||
<exclude name="PSR2.Methods.MethodDeclaration.Underscore" /> | ||
<exclude name="SlevomatCodingStandard.PHP.DisallowReference.DisallowedPassingByReference" /> | ||
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountAfterControlStructure" /> | ||
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeControlStructure" /> | ||
</rule> | ||
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
</ruleset> | ||
<?xml version="1.0" ?> | ||
<ruleset name="Project rules"> | ||
<file>src</file> | ||
<file>tests</file> | ||
<rule ref="vendor/pccomponentes/coding-standard/src/ruleset.xml"> | ||
<exclude name="PSR2.Methods.MethodDeclaration.Underscore" /> | ||
<exclude name="SlevomatCodingStandard.PHP.DisallowReference.DisallowedPassingByReference" /> | ||
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountAfterControlStructure" /> | ||
<exclude name="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountBeforeControlStructure" /> | ||
</rule> | ||
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="SlevomatCodingStandard.Operators.RequireOnlyStandaloneIncrementAndDecrementOperators.PostDecrementOperatorNotUsedStandalone"> | ||
<exclude-pattern>src/Doctrine/DBAL/Platforms/MicrosoftAccessPlatform.php</exclude-pattern> | ||
</rule> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/Doctrine/DBAL/Platforms/MicrosoftAccessPlatformTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace ZoiloMora\Tests\Doctrine\DBAL\Platforms; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use ZoiloMora\Tests\BaseTest; | ||
|
||
class MicrosoftAccessPlatformTest extends BaseTest | ||
{ | ||
private const TABLE_NAME = 'Table1'; | ||
|
||
/** | ||
* @test | ||
* @dataProvider connections | ||
*/ | ||
public function given_an_connection_when_get_the_first_two_rows_then_returns_array_with_two_rows(Connection $connection) | ||
{ | ||
$result = $connection->createQueryBuilder() | ||
->select('*') | ||
->from(self::TABLE_NAME) | ||
->setMaxResults(2) | ||
->execute(); | ||
|
||
$rows = $result->fetchAllAssociative(); | ||
|
||
$this->assertIsArray($rows); | ||
$this->assertCount(2, $rows); | ||
} | ||
} |