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
12 changes: 4 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>

<extensions>
<bootstrap class="LaminasIntegrationTest\Db\Extension\ListenerExtension" />
</extensions>

<testsuites>
<testsuite name="unit test">
Expand All @@ -19,9 +18,6 @@
</testsuite>
</testsuites>

<listeners>
<listener class="LaminasIntegrationTest\Db\IntegrationTestListener" file="./test/integration/IntegrationTestListener.php"/>
</listeners>

<php>
<!-- Note: the following is a FULL list of ALL POSSIBLE constants
Expand Down
1 change: 0 additions & 1 deletion src/Adapter/AdapterAbstractServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator
* Create a DB adapter
*
* @param string $requestedName
* @param array $options
* @return Adapter
*/
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
Expand Down
1 change: 0 additions & 1 deletion src/Adapter/AdapterServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class AdapterServiceFactory implements FactoryInterface
* Create db adapter service
*
* @param string $requestedName
* @param array $options
* @return Adapter
*/
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
Comment thread
tyrsson marked this conversation as resolved.
Expand Down
1 change: 0 additions & 1 deletion src/Adapter/Driver/AbstractConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public function inTransaction()
}

/**
* @param array $connectionParameters
* @return $this Provides a fluent interface
*/
public function setConnectionParameters(array $connectionParameters)
Expand Down
1 change: 0 additions & 1 deletion src/Adapter/Driver/Mysqli/Mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class Mysqli implements DriverInterface, Profiler\ProfilerAwareInterface
* Constructor
*
* @param array|Connection|\mysqli $connection
* @param array $options
*/
public function __construct(
$connection,
Expand Down
1 change: 0 additions & 1 deletion src/Adapter/Driver/Oci8/Oci8.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Oci8 implements DriverInterface, Profiler\ProfilerAwareInterface

/**
* @param array|Connection|\oci8 $connection
* @param array $options
* @param string $features
*/
public function __construct(
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/Driver/Oci8/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ protected function bindParametersFromContainer()
*/
public function __clone()
{
$this->isPrepared = false;
$this->resource = null;
$this->isPrepared = false;
$this->resource = null;
if ($this->parameterContainer) {
$this->parameterContainer = clone $this->parameterContainer;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/Driver/Pdo/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Laminas\Db\Adapter\Driver\AbstractConnection;
use Laminas\Db\Adapter\Exception;
use Laminas\Db\Adapter\Exception\RunTimeException;
use Laminas\Db\Adapter\Exception\RuntimeException;
use PDOException;
use PDOStatement;

Expand Down Expand Up @@ -84,7 +84,7 @@ public function setConnectionParameters(array $connectionParameters)
/**
* Get the dsn string for this connection
*
* @throws RunTimeException
* @throws RuntimeException
* @return string
*/
public function getDsn()
Expand Down
7 changes: 0 additions & 7 deletions src/Adapter/Driver/Sqlsrv/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ public function getSql()

/**
* @param string $sql
* @param array $options
* @return $this Provides a fluent interface
* @throws Exception\RuntimeException
*/
Expand Down Expand Up @@ -270,17 +269,11 @@ protected function bindParametersFromContainer()
}
}

/**
* @param array $prepareParams
*/
public function setPrepareParams(array $prepareParams)
{
$this->prepareParams = $prepareParams;
}

/**
* @param array $prepareOptions
*/
public function setPrepareOptions(array $prepareOptions)
{
$this->prepareOptions = $prepareOptions;
Expand Down
3 changes: 0 additions & 3 deletions src/Adapter/ParameterContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ class ParameterContainer implements Iterator, ArrayAccess, Countable

/**
* Constructor
*
* @param array $data
*/
public function __construct(array $data = [])
{
Expand Down Expand Up @@ -194,7 +192,6 @@ public function offsetUnset($name)
/**
* Set from array
*
* @param array $data
* @return $this Provides a fluent interface
*/
public function setFromArray(array $data)
Expand Down
1 change: 0 additions & 1 deletion src/Adapter/Platform/PlatformInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function getIdentifierSeparator();
* Quote identifier in fragment
*
* @param string $identifier
* @param array $additionalSafeWords
* @return string
*/
public function quoteIdentifierInFragment($identifier, array $additionalSafeWords = []);
Expand Down
2 changes: 0 additions & 2 deletions src/Metadata/Object/AbstractTableObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public function __construct($name)

/**
* Set columns
*
* @param array $columns
*/
public function setColumns(array $columns)
{
Expand Down
1 change: 0 additions & 1 deletion src/Metadata/Object/ColumnObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ public function getErratas()
}

/**
* @param array $erratas
* @return $this Provides a fluent interface
*/
public function setErratas(array $erratas)
Expand Down
1 change: 0 additions & 1 deletion src/RowGateway/AbstractRowGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public function initialize()
/**
* Populate Data
*
* @param array $rowData
* @param bool $rowExistsInDatabase
* @return $this Provides a fluent interface
*/
Expand Down
4 changes: 0 additions & 4 deletions src/RowGateway/Feature/FeatureSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class FeatureSet
/** @var array */
protected $magicSpecifications = [];

/**
* @param array $features
*/
public function __construct(array $features = [])
{
if ($features) {
Expand Down Expand Up @@ -59,7 +56,6 @@ public function getFeatureByClassName($featureClassName)
}

/**
* @param array $features
* @return $this Provides a fluent interface
*/
public function addFeatures(array $features)
Expand Down
1 change: 0 additions & 1 deletion src/Sql/Ddl/Column/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public function getDefault()
}

/**
* @param array $options
* @return $this Provides a fluent interface
*/
public function setOptions(array $options)
Expand Down
1 change: 0 additions & 1 deletion src/Sql/Ddl/Index/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Index extends AbstractIndex
/**
* @param string|array|null $columns
* @param null|string $name
* @param array $lengths
*/
public function __construct($columns, $name = null, array $lengths = [])
{
Expand Down
1 change: 0 additions & 1 deletion src/Sql/Expression.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public function getParameters(): float|array|int|string|bool
}

/**
* @return array
* @throws Exception\RuntimeException
*/
public function getExpressionData(): array
Expand Down
2 changes: 0 additions & 2 deletions src/Sql/Insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public function into($table)
/**
* Specify columns
*
* @param array $columns
* @return $this Provides a fluent interface
*/
public function columns(array $columns)
Expand Down Expand Up @@ -134,7 +133,6 @@ public function values($values, $flag = self::VALUES_SET)
*
* @link http://stackoverflow.com/questions/173400/how-to-check-if-php-array-is-associative-or-sequential
*
* @param array $array
* @return bool
*/
private function isAssocativeArray(array $array)
Expand Down
2 changes: 0 additions & 2 deletions src/Sql/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class Select extends AbstractPreparableSql
/** @var null|string|Expression */
protected $quantifier;

/** @var array */
protected array $columns = [self::SQL_STAR];

/** @var Join[] */
Expand Down Expand Up @@ -226,7 +225,6 @@ public function quantifier($quantifier)
* key string will be use as alias,
* value can be string or Expression objects
*
* @param array $columns
* @param bool $prefixColumnsWithTable
* @return $this Provides a fluent interface
*/
Expand Down
1 change: 0 additions & 1 deletion src/TableGateway/Feature/FeatureSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function getFeatureByClassName($featureClassName)
}

/**
* @param array $features
* @return $this Provides a fluent interface
*/
public function addFeatures(array $features)
Expand Down
1 change: 0 additions & 1 deletion test/integration/Adapter/Driver/Pdo/Mysql/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace LaminasIntegrationTest\Db\Adapter\Driver\Pdo\Mysql;

use Laminas\Db\Adapter\Adapter;
use Laminas\Db\Adapter\Driver\Pdo\Result as PdoResult;
use Laminas\Db\Adapter\Exception\RuntimeException;
use Laminas\Db\ResultSet\ResultSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function testInsert()
/**
* @see https://github.com/zendframework/zend-db/issues/35
* @see https://github.com/zendframework/zend-db/pull/178
*
* @return mixed
*/
public function testInsertWithExtendedCharsetFieldName()
Expand Down
48 changes: 48 additions & 0 deletions test/integration/Extension/IntegrationTestStartedListener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace LaminasIntegrationTest\Db\Extension;

use LaminasIntegrationTest\Db\Platform\FixtureLoader;
use LaminasIntegrationTest\Db\Platform\MysqlFixtureLoader;
use LaminasIntegrationTest\Db\Platform\PgsqlFixtureLoader;
use LaminasIntegrationTest\Db\Platform\SqlServerFixtureLoader;
use PHPUnit\Event\TestSuite\Started;
use PHPUnit\Event\TestSuite\StartedSubscriber;

use function getenv;
use function printf;

final class IntegrationTestStartedListener implements StartedSubscriber
{
/** @var FixtureLoader[] */
private $fixtureLoaders = [];

public function notify(Started $event): void
{
if ($event->testSuite()->name() !== 'integration test') {
return;
}

if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_MYSQL')) {
$this->fixtureLoaders[] = new MysqlFixtureLoader();
}

if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_PGSQL')) {
$this->fixtureLoaders[] = new PgsqlFixtureLoader();
}

if (getenv('TESTS_LAMINAS_DB_ADAPTER_DRIVER_SQLSRV')) {
$this->fixtureLoaders[] = new SqlServerFixtureLoader();
}

if (empty($this->fixtureLoaders)) {
return;
}

printf("\nIntegration test started.\n");
Comment thread
tyrsson marked this conversation as resolved.

foreach ($this->fixtureLoaders as $fixtureLoader) {
$fixtureLoader->createDatabase();
}
}
}
31 changes: 31 additions & 0 deletions test/integration/Extension/IntegrationTestStoppedListener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace LaminasIntegrationTest\Db\Extension;

use LaminasIntegrationTest\Db\Platform\FixtureLoader;
use PHPUnit\Event\TestSuite\Finished;
use PHPUnit\Event\TestSuite\FinishedSubscriber;

use function printf;

final class IntegrationTestStoppedListener implements FinishedSubscriber
{
/** @var FixtureLoader[] */
private $fixtureLoaders = [];

public function notify(Finished $event): void
{
if (
$event->testSuite()->name() !== 'integration test'
|| empty($this->fixtureLoaders)
) {
return;
}

printf("\nIntegration test ended.\n");

foreach ($this->fixtureLoaders as $fixtureLoader) {
$fixtureLoader->dropDatabase();
}
}
}
22 changes: 22 additions & 0 deletions test/integration/Extension/ListenerExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace LaminasIntegrationTest\Db\Extension;

use PHPUnit\Runner\Extension\Extension;
use PHPUnit\Runner\Extension\Facade;
use PHPUnit\Runner\Extension\ParameterCollection;
use PHPUnit\TextUI\Configuration\Configuration;

final class ListenerExtension implements Extension
{
public function bootstrap(
Configuration $configuration,
Facade $facade,
ParameterCollection $parameters
): void {
$facade->registerSubscribers(
new IntegrationTestStartedListener(),
new IntegrationTestStoppedListener(),
);
}
}
1 change: 0 additions & 1 deletion test/unit/Metadata/Source/OracleMetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ protected function setUp(): void

/**
* @dataProvider constraintDataProvider
* @param array $constraintData
*/
public function testGetConstraints(array $constraintData)
{
Expand Down