Skip to content
Permalink
Browse files

Merge pull request #661 from webimpress/phpunit-7.5

Updated to PHPUnit 7.5 only
  • Loading branch information...
TomHAnderson committed Jan 20, 2019
2 parents 2aee841 + 0fb0a38 commit 216c2f2a17d1afb15132386f0d499a2116c86032
@@ -58,7 +58,7 @@
"zendframework/zend-validator": "^2.10"
},
"require-dev": {
"phpunit/phpunit": "^6.5 || ^7.0",
"phpunit/phpunit": "^7.5.2",
"predis/predis": "^1.1",
"squizlabs/php_codesniffer": "^2.7",
"zendframework/zend-i18n": "^2.7",
@@ -39,7 +39,7 @@ class DoctrineCacheStorageTest extends TestCase
*/
protected $phpDatatypes = ['NULL', 'boolean', 'integer', 'double', 'string', 'array', 'object', 'resource'];
public function setUp()
protected function setUp()
{
$this->options = new AdapterOptions();
// @todo fix constructor as it is messy
@@ -57,7 +57,7 @@ public function setUp()
);
}
public function tearDown()
protected function tearDown()
{
// be sure the error handler has been stopped
if (ErrorHandler::started()) {
@@ -138,15 +138,15 @@ public function testDatatypesCapability()
{
$capabilities = $this->storage->getCapabilities();
$datatypes = $capabilities->getSupportedDatatypes();
$this->assertInternalType('array', $datatypes);
$this->assertIsArray($datatypes);
foreach ($datatypes as $sourceType => $targetType) {
$this->assertContains($sourceType, $this->phpDatatypes, 'Unknown source type "' . $sourceType . '"');
if (is_string($targetType)) {
$this->assertContains($targetType, $this->phpDatatypes, 'Unknown source type "' . $sourceType . '"');
} else {
$this->assertInternalType('bool', $targetType, 'Target type must be a string or boolean');
$this->assertIsBool($targetType, 'Target type must be a string or boolean');
}
}
}
@@ -155,38 +155,38 @@ public function testSupportedMetadataCapability()
{
$capabilities = $this->storage->getCapabilities();
$metadata = $capabilities->getSupportedMetadata();
$this->assertInternalType('array', $metadata);
$this->assertIsArray($metadata);
foreach ($metadata as $property) {
$this->assertInternalType('string', $property);
$this->assertIsString($property);
}
}
public function testTtlCapabilities()
{
$capabilities = $this->storage->getCapabilities();
$this->assertInternalType('integer', $capabilities->getMaxTtl());
$this->assertIsInt($capabilities->getMaxTtl());
$this->assertGreaterThanOrEqual(0, $capabilities->getMaxTtl());
$this->assertInternalType('bool', $capabilities->getStaticTtl());
$this->assertIsBool($capabilities->getStaticTtl());
$this->assertInternalType('numeric', $capabilities->getTtlPrecision());
$this->assertIsNumeric($capabilities->getTtlPrecision());
$this->assertGreaterThan(0, $capabilities->getTtlPrecision());
$this->assertInternalType('bool', $capabilities->getStaticTtl());
$this->assertIsBool($capabilities->getStaticTtl());
}
public function testKeyCapabilities()
{
$capabilities = $this->storage->getCapabilities();
$this->assertInternalType('integer', $capabilities->getMaxKeyLength());
$this->assertIsInt($capabilities->getMaxKeyLength());
$this->assertGreaterThanOrEqual(-1, $capabilities->getMaxKeyLength());
$this->assertInternalType('bool', $capabilities->getNamespaceIsPrefix());
$this->assertIsBool($capabilities->getNamespaceIsPrefix());
$this->assertInternalType('string', $capabilities->getNamespaceSeparator());
$this->assertIsString($capabilities->getNamespaceSeparator());
}
public function testHasItemReturnsTrueOnValidItem()
@@ -286,7 +286,7 @@ public function testGetMetadata()
$this->assertTrue($this->storage->setItem('key', 'value'));
$metadata = $this->storage->getMetadata('key');
$this->assertInternalType('array', $metadata);
$this->assertIsArray($metadata);
foreach ($supportedMetadatas as $supportedMetadata) {
$this->assertArrayHasKey($supportedMetadata, $metadata);
}
@@ -317,10 +317,10 @@ public function testGetMetadatas()
$this->assertSame([], $this->storage->setItems($items));
$metadatas = $this->storage->getMetadatas(array_keys($items));
$this->assertInternalType('array', $metadatas);
$this->assertIsArray($metadatas);
$this->assertSame(count($items), count($metadatas));
foreach ($metadatas as $metadata) {
$this->assertInternalType('array', $metadata);
$this->assertIsArray($metadata);
foreach ($supportedMetadatas as $supportedMetadata) {
$this->assertArrayHasKey($supportedMetadata, $metadata);
}
@@ -357,14 +357,14 @@ public function testSetGetHasAndRemoveItems()
$this->assertSame([], $this->storage->setItems($items));
$rs = $this->storage->getItems(array_keys($items));
$this->assertInternalType('array', $rs);
$this->assertIsArray($rs);
foreach ($items as $key => $value) {
$this->assertArrayHasKey($key, $rs);
$this->assertEquals($value, $rs[$key]);
}
$rs = $this->storage->hasItems(array_keys($items));
$this->assertInternalType('array', $rs);
$this->assertIsArray($rs);
$this->assertEquals(count($items), count($rs));
foreach ($items as $key => $value) {
$this->assertContains($key, $rs);
@@ -374,14 +374,14 @@ public function testSetGetHasAndRemoveItems()
unset($items['key1'], $items['key3']);
$rs = $this->storage->getItems(array_keys($items));
$this->assertInternalType('array', $rs);
$this->assertIsArray($rs);
foreach ($items as $key => $value) {
$this->assertArrayHasKey($key, $rs);
$this->assertEquals($value, $rs[$key]);
}
$rs = $this->storage->hasItems(array_keys($items));
$this->assertInternalType('array', $rs);
$this->assertIsArray($rs);
$this->assertEquals(count($items), count($rs));
foreach ($items as $key => $value) {
$this->assertContains($key, $rs);
@@ -434,14 +434,14 @@ public function testSetGetHasAndRemoveItemsWithNamespace()
$this->options->setNamespace('defaultns1');
$rs = $this->storage->getItems(array_keys($items));
$this->assertInternalType('array', $rs);
$this->assertIsArray($rs);
foreach ($items as $key => $value) {
$this->assertArrayHasKey($key, $rs);
$this->assertEquals($value, $rs[$key]);
}
$rs = $this->storage->hasItems(array_keys($items));
$this->assertInternalType('array', $rs);
$this->assertIsArray($rs);
$this->assertEquals(count($items), count($rs));
foreach ($items as $key => $value) {
$this->assertContains($key, $rs);
@@ -452,14 +452,14 @@ public function testSetGetHasAndRemoveItemsWithNamespace()
unset($items['key1'], $items['key3']);
$rs = $this->storage->getItems(array_keys($items));
$this->assertInternalType('array', $rs);
$this->assertIsArray($rs);
foreach ($items as $key => $value) {
$this->assertArrayHasKey($key, $rs);
$this->assertEquals($value, $rs[$key]);
}
$rs = $this->storage->hasItems(array_keys($items));
$this->assertInternalType('array', $rs);
$this->assertIsArray($rs);
$this->assertEquals(count($items), count($rs));
foreach ($items as $key => $value) {
$this->assertContains($key, $rs);
@@ -18,7 +18,7 @@ public function testInvokeHasCorrectKeys()
{
$config = (new ConfigProvider())->__invoke();
self::assertInternalType('array', $config);
self::assertIsArray($config);
self::assertArrayHasKey('doctrine', $config, 'Expected config to have "doctrine" array key');
self::assertArrayHasKey('doctrine_factories', $config, 'Expected config to have "doctrine_factories" array key');
@@ -37,7 +37,7 @@ class CliControllerTest extends AbstractConsoleControllerTestCase
/**
* {@inheritDoc}
*/
public function setUp()
protected function setUp()
{
$this->setApplicationConfig(ServiceManagerFactory::getConfiguration());
parent::setUp();
@@ -11,7 +11,7 @@
* @license MIT
* @link http://www.doctrine-project.org/
* @author Kyle Spraggs <theman@spiffyjr.me>
* @covers DoctrineModule\Form\Element\ObjectMultiCheckbox
* @covers \DoctrineModule\Form\Element\ObjectMultiCheckbox
*/
class ObjectMultiCheckboxTest extends ProxyAwareElementTestCase
{
@@ -7,7 +7,7 @@
/**
* Tests for the ObjectRadio element
*
* @covers DoctrineModule\Form\Element\ObjectRadio
* @covers \DoctrineModule\Form\Element\ObjectRadio
*/
class ObjectRadioTest extends ProxyAwareElementTestCase
{
@@ -11,7 +11,7 @@
* @license MIT
* @link http://www.doctrine-project.org/
* @author Kyle Spraggs <theman@spiffyjr.me>
* @covers DoctrineModule\Form\Element\ObjectSelect
* @covers \DoctrineModule\Form\Element\ObjectSelect
*/
class ObjectSelectTest extends ProxyAwareElementTestCase
{
@@ -13,7 +13,7 @@
* @license MIT
* @link http://www.doctrine-project.org/
* @author Kyle Spraggs <theman@spiffyjr.me>
* @covers DoctrineModule\Form\Element\Proxy
* @covers \DoctrineModule\Form\Element\Proxy
*/
class ProxyTest extends TestCase
{
@@ -35,7 +35,7 @@ class ModuleTest extends TestCase
*/
private $cli;
public function setUp()
protected function setUp()
{
$this->application = $this->getMockBuilder('Zend\Mvc\Application')
->disableOriginalConstructor()
@@ -74,7 +74,7 @@ public function testGetConfig()
$config = $module->getConfig();
$this->assertInternalType('array', $config);
$this->assertIsArray($config);
$this->assertArrayHasKey('doctrine', $config);
$this->assertArrayHasKey('doctrine_factories', $config);
$this->assertArrayHasKey('service_manager', $config);
@@ -42,7 +42,7 @@ class SymfonyCliTest extends TestCase
/**
* {@inheritDoc}
*/
public function setUp()
protected function setUp()
{
$this->route = new SymfonyCli(new Application());
}
@@ -22,7 +22,7 @@ class ModuleDefinedServicesTest extends TestCase
/**
* {@inheritDoc}
*/
public function setUp()
protected function setUp()
{
$this->serviceManager = ServiceManagerFactory::getServiceManager();
}
Oops, something went wrong.

0 comments on commit 216c2f2

Please sign in to comment.
You can’t perform that action at this time.