File tree Expand file tree Collapse file tree 7 files changed +140
-20
lines changed
test/integration/Container Expand file tree Collapse file tree 7 files changed +140
-20
lines changed Original file line number Diff line number Diff line change 12
12
<code ><![CDATA[ ResultSetInterface]]> </code >
13
13
</UnnecessaryVarAnnotation >
14
14
</file >
15
- <file src =" src/Container/DriverFeatureFactory.php" >
16
- <UnusedClass >
17
- <code ><![CDATA[ DriverFeatureFactory]]> </code >
18
- </UnusedClass >
19
- </file >
20
15
<file src =" src/Container/MysqliResultFactory.php" >
21
16
<UnusedParam >
22
17
<code ><![CDATA[ $container]]> </code >
23
18
</UnusedParam >
24
19
</file >
25
- <file src =" src/Container/MysqliStatementFactory.php" >
26
- <UndefinedVariable >
27
- <code ><![CDATA[ $bufferResults]]> </code >
28
- </UndefinedVariable >
29
- </file >
30
20
<file src =" src/Container/PdoResultFactory.php" >
31
21
<UnusedParam >
32
22
<code ><![CDATA[ $container]]> </code >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public function __invoke(ContainerInterface $container): StatementInterface&Stat
22
22
$ options = $ dbConfig ['options ' ] ?? [];
23
23
24
24
/** @var bool $bufferResults */
25
- $ bufferResults = $ options ['buffer_results ' ] ?? $ bufferResults ;
25
+ $ bufferResults = $ options ['buffer_results ' ] ?? false ;
26
26
27
27
return new Statement (bufferResults: $ bufferResults );
28
28
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace LaminasIntegrationTest \Db \Adapter \Mysql \Container ;
6
+
7
+ use Laminas \Db \Adapter \Driver \ConnectionInterface ;
8
+ use Laminas \Db \Adapter \Mysql \Container \MysqliConnectionFactory ;
9
+ use Laminas \Db \Adapter \Mysql \Driver \Mysqli \Connection ;
10
+ use PHPUnit \Framework \Attributes ;
11
+ use PHPUnit \Framework \TestCase ;
12
+
13
+ #[Attributes \CoversClass(MysqliConnectionFactory::class)]
14
+ #[Attributes \CoversMethod(MysqliConnectionFactory::class, '__invoke ' )]
15
+ #[Attributes \Group('container ' )]
16
+ #[Attributes \Group('integration ' )]
17
+ #[Attributes \Group('integration-mysqli ' )]
18
+ final class MysqliConnectionFactoryTest extends TestCase
19
+ {
20
+ use TestAsset \SetupTrait;
21
+
22
+ public function testInvokeReturnsMysqliConnection (): void
23
+ {
24
+ $ this ->getAdapter ([
25
+ 'db ' => [
26
+ 'driver ' => 'Mysqli ' ,
27
+ ],
28
+ ]);
29
+
30
+ $ factory = new MysqliConnectionFactory ();
31
+ $ connection = $ factory ($ this ->container );
32
+
33
+ self ::assertInstanceOf (ConnectionInterface::class, $ connection );
34
+ self ::assertInstanceOf (Connection::class, $ connection );
35
+ }
36
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace LaminasIntegrationTest \Db \Adapter \Mysql \Container ;
6
+
7
+ use Laminas \Db \Adapter \Driver \DriverInterface ;
8
+ use Laminas \Db \Adapter \Mysql \Container \MysqliDriverFactory ;
9
+ use Laminas \Db \Adapter \Mysql \Driver \Mysqli \Mysqli ;
10
+ use PHPUnit \Framework \Attributes ;
11
+ use PHPUnit \Framework \TestCase ;
12
+
13
+ #[Attributes \CoversClass(MysqliDriverFactory::class)]
14
+ #[Attributes \CoversMethod(MysqliDriverFactory::class, '__invoke ' )]
15
+ #[Attributes \Group('container ' )]
16
+ #[Attributes \Group('integration ' )]
17
+ #[Attributes \Group('integration-mysqli ' )]
18
+ final class MysqliDriverFactoryTest extends TestCase
19
+ {
20
+ use TestAsset \SetupTrait;
21
+
22
+ public function testFactoryReturnsMysqliDriver (): void
23
+ {
24
+ $ this ->getAdapter ([
25
+ 'db ' => [
26
+ 'driver ' => 'Mysqli ' ,
27
+ ],
28
+ ]);
29
+ $ factory = new MysqliDriverFactory ();
30
+ $ driver = $ factory ($ this ->container );
31
+ self ::assertInstanceOf (DriverInterface::class, $ driver );
32
+ $ this ->assertInstanceOf (Mysqli::class, $ driver );
33
+ }
34
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace LaminasIntegrationTest \Db \Adapter \Mysql \Container ;
6
+
7
+ use Laminas \Db \Adapter \Driver \ResultInterface ;
8
+ use Laminas \Db \Adapter \Mysql \Container \MysqliResultFactory ;
9
+ use Laminas \Db \Adapter \Mysql \Driver \Mysqli \Result ;
10
+ use PHPUnit \Framework \Attributes ;
11
+ use PHPUnit \Framework \TestCase ;
12
+
13
+ #[Attributes \CoversClass(MysqliResultFactory::class)]
14
+ #[Attributes \CoversMethod(MysqliResultFactory::class, '__invoke ' )]
15
+ #[Attributes \Group('container ' )]
16
+ #[Attributes \Group('integration ' )]
17
+ #[Attributes \Group('integration-mysqli ' )]
18
+ final class MysqliResultFactoryTest extends TestCase
19
+ {
20
+ use TestAsset \SetupTrait;
21
+
22
+ public function testInvokeReturnsMysqliResult (): void
23
+ {
24
+ $ factory = new MysqliResultFactory ();
25
+ $ result = $ factory ($ this ->container );
26
+
27
+ self ::assertInstanceOf (ResultInterface::class, $ result );
28
+ self ::assertInstanceOf (Result::class, $ result );
29
+ }
30
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace LaminasIntegrationTest \Db \Adapter \Mysql \Container ;
6
+
7
+ use Laminas \Db \Adapter \Driver \StatementInterface ;
8
+ use Laminas \Db \Adapter \Mysql \Container \MysqliStatementFactory ;
9
+ use Laminas \Db \Adapter \Mysql \Driver \Mysqli \Statement ;
10
+ use PHPUnit \Framework \Attributes ;
11
+ use PHPUnit \Framework \TestCase ;
12
+
13
+ #[Attributes \CoversClass(MysqliStatementFactory::class)]
14
+ #[Attributes \CoversMethod(MysqliStatementFactory::class, '__invoke ' )]
15
+ #[Attributes \Group('container ' )]
16
+ #[Attributes \Group('integration ' )]
17
+ #[Attributes \Group('integration-mysqli ' )]
18
+ final class MysqliStatementFactoryTest extends TestCase
19
+ {
20
+ use TestAsset \SetupTrait;
21
+
22
+ public function testInvokeReturnsMysqliStatement (): void
23
+ {
24
+ $ this ->getAdapter ([
25
+ 'db ' => [
26
+ 'driver ' => 'Mysqli ' ,
27
+ 'options ' => [
28
+ 'buffer_results ' => false ,
29
+ ],
30
+ ],
31
+ ]);
32
+
33
+ $ factory = new MysqliStatementFactory ();
34
+ $ statement = $ factory ($ this ->container );
35
+
36
+ self ::assertInstanceOf (StatementInterface::class, $ statement );
37
+ self ::assertInstanceOf (Statement::class, $ statement );
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments