From 22a7582d05c9dd6c305fd0d75db772ce7c0a4e6b Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Mon, 29 Jan 2018 02:57:40 -0200 Subject: [PATCH 1/4] Add mising @var --- tests/Doctrine/Tests/DBAL/ConnectionTest.php | 3 +++ .../Tests/DBAL/Functional/DataAccessTest.php | 3 +++ .../DBAL/Functional/ModifyLimitQueryTest.php | 3 +++ .../Tests/DBAL/Functional/PortabilityTest.php | 3 +++ .../Tests/DBAL/Functional/ResultCacheTest.php | 7 +++++++ .../DBAL/Functional/TableGeneratorTest.php | 3 +++ .../DBAL/Functional/Ticket/DBAL630Test.php | 3 +++ .../DBAL/Functional/TypeConversionTest.php | 3 +++ .../DBAL/Platforms/SQLAzurePlatformTest.php | 4 +++- .../Query/Expression/ExpressionBuilderTest.php | 3 +++ .../Tests/DBAL/Query/QueryBuilderTest.php | 3 +++ .../DBAL/Sharding/SQLAzure/AbstractTestCase.php | 7 +++++++ .../DBAL/Tools/Console/RunSqlCommandTest.php | 3 +++ tests/Doctrine/Tests/DBAL/Types/ArrayTest.php | 12 +++++++++--- tests/Doctrine/Tests/DBAL/Types/BooleanTest.php | 12 +++++++++--- tests/Doctrine/Tests/DBAL/Types/DecimalTest.php | 12 +++++++++--- tests/Doctrine/Tests/DBAL/Types/FloatTest.php | 10 +++++++++- .../Doctrine/Tests/DBAL/Types/GuidTypeTest.php | 12 +++++++++--- tests/Doctrine/Tests/DBAL/Types/IntegerTest.php | 12 +++++++++--- tests/Doctrine/Tests/DBAL/Types/ObjectTest.php | 12 +++++++++--- .../Doctrine/Tests/DBAL/Types/SmallIntTest.php | 12 +++++++++--- tests/Doctrine/Tests/DBAL/Types/StringTest.php | 12 +++++++++--- .../Tests/DBAL/Types/VarDateTimeTest.php | 12 +++++++++--- .../Tests/DbalPerformanceTestListener.php | 3 +++ tests/Doctrine/Tests/Mocks/ConnectionMock.php | 17 ++++++++++++++++- .../Tests/Mocks/DatabasePlatformMock.php | 13 ++++++++++++- tests/Doctrine/Tests/Mocks/DriverMock.php | 6 ++++++ tests/Doctrine/Tests/Mocks/TaskMock.php | 3 +++ 28 files changed, 177 insertions(+), 31 deletions(-) diff --git a/tests/Doctrine/Tests/DBAL/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/ConnectionTest.php index 46a3c49df02..1455408b0a0 100644 --- a/tests/Doctrine/Tests/DBAL/ConnectionTest.php +++ b/tests/Doctrine/Tests/DBAL/ConnectionTest.php @@ -30,6 +30,9 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase */ protected $_conn = null; + /** + * @var array + */ protected $params = array( 'driver' => 'pdo_mysql', 'host' => 'localhost', diff --git a/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php b/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php index 503594d8ebf..c02a0731ddc 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php @@ -11,6 +11,9 @@ class DataAccessTest extends \Doctrine\Tests\DbalFunctionalTestCase { + /** + * @var bool + */ static private $generated = false; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php b/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php index f03dc0f11f1..a0a0b6289da 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php @@ -4,6 +4,9 @@ class ModifyLimitQueryTest extends \Doctrine\Tests\DbalFunctionalTestCase { + /** + * @var bool + */ private static $tableCreated = false; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php b/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php index d76abdaca29..3a9a777b6b3 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php @@ -13,6 +13,9 @@ */ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase { + /** + * @var Connection + */ private $portableConnection; protected function tearDown() diff --git a/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php b/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php index 367a09f9e35..94d67ea0148 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php @@ -10,7 +10,14 @@ */ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase { + /** + * @var Type + */ private $expectedResult = array(array('test_int' => 100, 'test_string' => 'foo'), array('test_int' => 200, 'test_string' => 'bar'), array('test_int' => 300, 'test_string' => 'baz')); + + /** + * @var \Doctrine\DBAL\Logging\DebugStack + */ private $sqlLogger; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Functional/TableGeneratorTest.php b/tests/Doctrine/Tests/DBAL/Functional/TableGeneratorTest.php index fba243319eb..b8c63644a85 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/TableGeneratorTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/TableGeneratorTest.php @@ -9,6 +9,9 @@ */ class TableGeneratorTest extends \Doctrine\Tests\DbalFunctionalTestCase { + /** + * @var TableGenerator + */ private $generator; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php b/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php index a0816b35303..0015509524d 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php @@ -11,6 +11,9 @@ */ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase { + /** + * @var bool + */ private $running = false; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php b/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php index aa3231810cb..2e2d97b3fb6 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php @@ -6,6 +6,9 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase { + /** + * @var int + */ static private $typeCounter = 0; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Platforms/SQLAzurePlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/SQLAzurePlatformTest.php index c5b07b1bc1a..f1b93e0eb48 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/SQLAzurePlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/SQLAzurePlatformTest.php @@ -9,6 +9,9 @@ */ class SQLAzurePlatformTest extends DbalTestCase { + /** + * @var \Doctrine\DBAL\Platforms\SQLAzurePlatform + */ private $platform; protected function setUp() @@ -26,4 +29,3 @@ public function testCreateFederatedOnTable() self::assertEquals(array('CREATE TABLE tbl (id INT NOT NULL) FEDERATED ON (TblId = id)'), $this->platform->getCreateTableSQL($table)); } } - diff --git a/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php b/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php index 61cf87df1c8..fd3c18c6c78 100644 --- a/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php +++ b/tests/Doctrine/Tests/DBAL/Query/Expression/ExpressionBuilderTest.php @@ -10,6 +10,9 @@ */ class ExpressionBuilderTest extends \Doctrine\Tests\DbalTestCase { + /** + * @var ExpressionBuilder + */ protected $expr; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php b/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php index 26058b25942..f3305bebaf2 100644 --- a/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php +++ b/tests/Doctrine/Tests/DBAL/Query/QueryBuilderTest.php @@ -11,6 +11,9 @@ */ class QueryBuilderTest extends \Doctrine\Tests\DbalTestCase { + /** + * @var \Doctrine\DBAL\Connection + */ protected $conn; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/AbstractTestCase.php b/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/AbstractTestCase.php index abb68c784bf..795b7a13f94 100644 --- a/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/AbstractTestCase.php +++ b/tests/Doctrine/Tests/DBAL/Sharding/SQLAzure/AbstractTestCase.php @@ -8,7 +8,14 @@ abstract class AbstractTestCase extends \PHPUnit\Framework\TestCase { + /** + * @var \Doctrine\DBAL\Connection + */ protected $conn; + + /** + * @var SQLAzureShardManager + */ protected $sm; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php b/tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php index e5e995f53dc..164a609198a 100644 --- a/tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php +++ b/tests/Doctrine/Tests/DBAL/Tools/Console/RunSqlCommandTest.php @@ -14,6 +14,9 @@ class RunSqlCommandTest extends \PHPUnit\Framework\TestCase /** @var RunSqlCommand */ private $command; + /** + * @var \Doctrine\DBAL\Connection + */ private $connectionMock; protected function setUp() diff --git a/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php b/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php index 1ec3d5f121e..485659453c5 100644 --- a/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php @@ -7,9 +7,15 @@ class ArrayTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php b/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php index 30b0874874a..0c5cb3ccecd 100644 --- a/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/BooleanTest.php @@ -7,9 +7,15 @@ class BooleanTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php b/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php index 49c75845509..9571629af25 100644 --- a/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/DecimalTest.php @@ -7,9 +7,15 @@ class DecimalTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/FloatTest.php b/tests/Doctrine/Tests/DBAL/Types/FloatTest.php index d4e58b505cc..036481ce10e 100644 --- a/tests/Doctrine/Tests/DBAL/Types/FloatTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/FloatTest.php @@ -7,7 +7,15 @@ class FloatTest extends \Doctrine\Tests\DbalTestCase { - protected $_platform, $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php b/tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php index 63b7bc5c43e..e8f79c635e9 100644 --- a/tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/GuidTypeTest.php @@ -7,9 +7,15 @@ class GuidTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php b/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php index e4c7b475293..51d57d5c98e 100644 --- a/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/IntegerTest.php @@ -7,9 +7,15 @@ class IntegerTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php b/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php index a314adcf0aa..0b3836d8cb9 100644 --- a/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/ObjectTest.php @@ -7,9 +7,15 @@ class ObjectTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php b/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php index eb0f381de5a..89a50117e15 100644 --- a/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/SmallIntTest.php @@ -7,9 +7,15 @@ class SmallIntTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/StringTest.php b/tests/Doctrine/Tests/DBAL/Types/StringTest.php index 4c20268f0a5..e968b9f0d99 100644 --- a/tests/Doctrine/Tests/DBAL/Types/StringTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/StringTest.php @@ -7,9 +7,15 @@ class StringTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php b/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php index d9c47b02f86..4af76968cf1 100644 --- a/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/VarDateTimeTest.php @@ -7,9 +7,15 @@ class VarDateTimeTest extends \Doctrine\Tests\DbalTestCase { - protected - $_platform, - $_type; + /** + * @var MockPlatform + */ + protected $_platform; + + /** + * @var Type + */ + protected $_type; protected function setUp() { diff --git a/tests/Doctrine/Tests/DbalPerformanceTestListener.php b/tests/Doctrine/Tests/DbalPerformanceTestListener.php index 9930845812d..a34943f0a52 100644 --- a/tests/Doctrine/Tests/DbalPerformanceTestListener.php +++ b/tests/Doctrine/Tests/DbalPerformanceTestListener.php @@ -9,6 +9,9 @@ */ class DbalPerformanceTestListener extends \PHPUnit\Framework\BaseTestListener { + /** + * @var array + */ private $timings = []; /** diff --git a/tests/Doctrine/Tests/Mocks/ConnectionMock.php b/tests/Doctrine/Tests/Mocks/ConnectionMock.php index 6694d19f4d4..3961399873e 100644 --- a/tests/Doctrine/Tests/Mocks/ConnectionMock.php +++ b/tests/Doctrine/Tests/Mocks/ConnectionMock.php @@ -4,9 +4,24 @@ class ConnectionMock extends \Doctrine\DBAL\Connection { + /** + * @var + */ private $_fetchOneResult; + + /** + * @var DatabasePlatformMock + */ private $_platformMock; + + /** + * @var int + */ private $_lastInsertId = 0; + + /** + * @var array + */ private $_inserts = array(); public function __construct(array $params, $driver, $config = null, $eventManager = null) @@ -84,4 +99,4 @@ public function reset() $this->_inserts = array(); $this->_lastInsertId = 0; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php b/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php index aeca0fd6dde..021746831af 100644 --- a/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php +++ b/tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php @@ -6,8 +6,19 @@ class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform { + /** + * @var string + */ private $_sequenceNextValSql = ""; + + /** + * @var bool + */ private $_prefersIdentityColumns = true; + + /** + * @var bool + */ private $_prefersSequences = false; /** @@ -87,4 +98,4 @@ public function getBlobTypeDeclarationSQL(array $field) { throw DBALException::notSupported(__METHOD__); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Mocks/DriverMock.php b/tests/Doctrine/Tests/Mocks/DriverMock.php index f115a0067e8..b3a2628fc9a 100644 --- a/tests/Doctrine/Tests/Mocks/DriverMock.php +++ b/tests/Doctrine/Tests/Mocks/DriverMock.php @@ -5,8 +5,14 @@ class DriverMock implements \Doctrine\DBAL\Driver { + /** + * @var DatabasePlatformMock + */ private $_platformMock; + /** + * @var SchemaManagerMock + */ private $_schemaManagerMock; public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) diff --git a/tests/Doctrine/Tests/Mocks/TaskMock.php b/tests/Doctrine/Tests/Mocks/TaskMock.php index be6de9cca59..4502703d9ac 100644 --- a/tests/Doctrine/Tests/Mocks/TaskMock.php +++ b/tests/Doctrine/Tests/Mocks/TaskMock.php @@ -37,6 +37,9 @@ class TaskMock extends \Doctrine\Common\Cli\Tasks\AbstractTask */ static public $instances = array(); + /** + * @var int + */ private $runCounter = 0; /** From bde444d10a98282b0d8e973615638a63d7488800 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Mon, 29 Jan 2018 19:28:21 -0200 Subject: [PATCH 2/4] Improve arrays type hints --- tests/Doctrine/Tests/DBAL/ConnectionTest.php | 2 +- tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php | 2 +- tests/Doctrine/Tests/DbalPerformanceTestListener.php | 2 +- tests/Doctrine/Tests/Mocks/ConnectionMock.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Doctrine/Tests/DBAL/ConnectionTest.php b/tests/Doctrine/Tests/DBAL/ConnectionTest.php index 1455408b0a0..897d44302cd 100644 --- a/tests/Doctrine/Tests/DBAL/ConnectionTest.php +++ b/tests/Doctrine/Tests/DBAL/ConnectionTest.php @@ -31,7 +31,7 @@ class ConnectionTest extends \Doctrine\Tests\DbalTestCase protected $_conn = null; /** - * @var array + * @var string[] */ protected $params = array( 'driver' => 'pdo_mysql', diff --git a/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php b/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php index 94d67ea0148..062d27658a3 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php @@ -11,7 +11,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase { /** - * @var Type + * @var int[][]|string[][] */ private $expectedResult = array(array('test_int' => 100, 'test_string' => 'foo'), array('test_int' => 200, 'test_string' => 'bar'), array('test_int' => 300, 'test_string' => 'baz')); diff --git a/tests/Doctrine/Tests/DbalPerformanceTestListener.php b/tests/Doctrine/Tests/DbalPerformanceTestListener.php index a34943f0a52..61b01587bba 100644 --- a/tests/Doctrine/Tests/DbalPerformanceTestListener.php +++ b/tests/Doctrine/Tests/DbalPerformanceTestListener.php @@ -10,7 +10,7 @@ class DbalPerformanceTestListener extends \PHPUnit\Framework\BaseTestListener { /** - * @var array + * @var string[][] */ private $timings = []; diff --git a/tests/Doctrine/Tests/Mocks/ConnectionMock.php b/tests/Doctrine/Tests/Mocks/ConnectionMock.php index 3961399873e..a35154ea853 100644 --- a/tests/Doctrine/Tests/Mocks/ConnectionMock.php +++ b/tests/Doctrine/Tests/Mocks/ConnectionMock.php @@ -20,7 +20,7 @@ class ConnectionMock extends \Doctrine\DBAL\Connection private $_lastInsertId = 0; /** - * @var array + * @var string[][] */ private $_inserts = array(); From 76583b4956da14b63dbc446fa7ac6a07a2783c43 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Fri, 2 Feb 2018 09:26:20 -0200 Subject: [PATCH 3/4] Remove unused methods and proprity --- tests/Doctrine/Tests/Mocks/ConnectionMock.php | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/tests/Doctrine/Tests/Mocks/ConnectionMock.php b/tests/Doctrine/Tests/Mocks/ConnectionMock.php index a35154ea853..f2b7c801578 100644 --- a/tests/Doctrine/Tests/Mocks/ConnectionMock.php +++ b/tests/Doctrine/Tests/Mocks/ConnectionMock.php @@ -4,11 +4,6 @@ class ConnectionMock extends \Doctrine\DBAL\Connection { - /** - * @var - */ - private $_fetchOneResult; - /** * @var DatabasePlatformMock */ @@ -58,14 +53,6 @@ public function lastInsertId($seqName = null) return $this->_lastInsertId; } - /** - * @override - */ - public function fetchColumn($statement, array $params = array(), $colnum = 0, array $types = array()) - { - return $this->_fetchOneResult; - } - /** * @override */ @@ -77,13 +64,6 @@ public function quote($input, $type = null) return $input; } - /* Mock API */ - - public function setFetchOneResult($fetchOneResult) - { - $this->_fetchOneResult = $fetchOneResult; - } - public function setLastInsertId($id) { $this->_lastInsertId = $id; From 3796bd2b3f4d9a43a9ecfafd58d27d70920a1777 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Mon, 5 Feb 2018 11:30:31 -0200 Subject: [PATCH 4/4] Improve annotations --- tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php | 5 +++-- tests/Doctrine/Tests/DBAL/Types/ArrayTest.php | 3 ++- tests/Doctrine/Tests/Mocks/DriverMock.php | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php b/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php index 062d27658a3..ef5bcdfb94e 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/ResultCacheTest.php @@ -4,6 +4,7 @@ use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\DBAL\FetchMode; +use Doctrine\DBAL\Logging\DebugStack; /** * @group DDC-217 @@ -16,7 +17,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase private $expectedResult = array(array('test_int' => 100, 'test_string' => 'foo'), array('test_int' => 200, 'test_string' => 'bar'), array('test_int' => 300, 'test_string' => 'baz')); /** - * @var \Doctrine\DBAL\Logging\DebugStack + * @var DebugStack */ private $sqlLogger; @@ -37,7 +38,7 @@ protected function setUp() } $config = $this->_conn->getConfiguration(); - $config->setSQLLogger($this->sqlLogger = new \Doctrine\DBAL\Logging\DebugStack); + $config->setSQLLogger($this->sqlLogger = new DebugStack); $cache = new \Doctrine\Common\Cache\ArrayCache; $config->setResultCacheImpl($cache); diff --git a/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php b/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php index 485659453c5..0e86b2eadef 100644 --- a/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php +++ b/tests/Doctrine/Tests/DBAL/Types/ArrayTest.php @@ -2,13 +2,14 @@ namespace Doctrine\Tests\DBAL\Types; +use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\Type; use Doctrine\Tests\DBAL\Mocks\MockPlatform; class ArrayTest extends \Doctrine\Tests\DbalTestCase { /** - * @var MockPlatform + * @var AbstractPlatform */ protected $_platform; diff --git a/tests/Doctrine/Tests/Mocks/DriverMock.php b/tests/Doctrine/Tests/Mocks/DriverMock.php index b3a2628fc9a..61b2d992aff 100644 --- a/tests/Doctrine/Tests/Mocks/DriverMock.php +++ b/tests/Doctrine/Tests/Mocks/DriverMock.php @@ -2,6 +2,7 @@ namespace Doctrine\Tests\Mocks; +use Doctrine\DBAL\Schema\AbstractSchemaManager; class DriverMock implements \Doctrine\DBAL\Driver { @@ -11,7 +12,7 @@ class DriverMock implements \Doctrine\DBAL\Driver private $_platformMock; /** - * @var SchemaManagerMock + * @var AbstractSchemaManager */ private $_schemaManagerMock; @@ -61,7 +62,7 @@ public function setDatabasePlatform(\Doctrine\DBAL\Platforms\AbstractPlatform $p $this->_platformMock = $platform; } - public function setSchemaManager(\Doctrine\DBAL\Schema\AbstractSchemaManager $sm) + public function setSchemaManager(AbstractSchemaManager $sm) { $this->_schemaManagerMock = $sm; }