Skip to content

Commit

Permalink
symfony#37180 fixed deprecations tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bennett committed Jun 10, 2020
1 parent d85d4e8 commit 01149d0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/Symfony/Component/Lock/Tests/Store/MongoDbStoreTest.php
Expand Up @@ -124,12 +124,19 @@ public function provideConstructorArgs()

/**
* @dataProvider provideDeprecatedDatabaseConstructorArgs
* @group legacy
*/
public function testDeprecatedDatabaseConstructionMethods($mongo, array $options)
{
$this->expectDeprecation('');
$this->expectDeprecation('Since symfony/lock 5.2: Constructing a "Symfony\Component\Lock\Store\MongoDbStore" by passing the "database" via a connection URI is deprecated. Either contruct with a "MongoDB\Collection" or pass it via $options instead.');

new MongoDbStore($mongo, $options);

$store->save($key);
$this->assertTrue($store->exists($key));

$store->delete($key);
$this->assertFalse($store->exists($key));
}

public function provideDeprecatedDatabaseConstructorArgs()
Expand All @@ -139,12 +146,19 @@ public function provideDeprecatedDatabaseConstructorArgs()

/**
* @dataProvider provideDeprecatedCollectionConstructorArgs
* @group legacy
*/
public function testDeprecatedCollectionConstructionMethods($mongo, array $options)
{
$this->expectDeprecation('');
$this->expectDeprecation('Since symfony/lock 5.2: Constructing a "Symfony\Component\Lock\Store\MongoDbStore" by passing the "collection" via a connection URI is deprecated. Either contruct with a "MongoDB\Collection" or pass it via $options instead.');

new MongoDbStore($mongo, $options);

$store->save($key);
$this->assertTrue($store->exists($key));

$store->delete($key);
$this->assertFalse($store->exists($key));
}

public function provideDeprecatedCollectionConstructorArgs()
Expand Down

0 comments on commit 01149d0

Please sign in to comment.