8000 [Lock] Create a lock component by jderusse · Pull Request #21093 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Lock] Create a lock component #21093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter 8000

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
Prev Previous commit
Next Next commit
Migrate tests to Phpunit 6
  • Loading branch information
jderusse committed Feb 22, 2017
commit 6d12ac1455521b7842a0ef9ed7c3575352ad1faa
3 changes: 2 additions & 1 deletion src/Symfony/Component/Lock/Tests/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Lock\Tests;

use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use Symfony\Component\Lock\Factory;
use Symfony\Component\Lock\LockInterface;
Expand All @@ -19,7 +20,7 @@
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
class FactoryTest extends \PHPUnit_Framework_TestCase
class FactoryTest extends TestCase
{
public function testCreateLock()
{
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Component/Lock/Tests/LockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\Lock\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Lock\Exception\LockConflictedException;
use Symfony\Component\Lock\Key;
use Symfony\Component\Lock\Lock;
Expand All @@ -19,7 +20,7 @@
/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
class LockTest extends \PHPUnit_Framework_TestCase
class LockTest extends TestCase
{
public function testAcquireNoBlocking()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

namespace Symfony\Component\Lock\Tests\Quorum;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Lock\Quorum\ConsensusStrategy;

/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
class ConsensusStrategyTest extends \PHPUnit_Framework_TestCase
class ConsensusStrategyTest extends TestCase
{
/** @var ConsensusStrategy */
private $quorum;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

namespace Symfony\Component\Lock\Tests\Quorum;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Lock\Quorum\UnanimousStrategy;

/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
class UnanimousStrategyTest extends \PHPUnit_Framework_TestCase
class UnanimousStrategyTest extends TestCase
{
/** @var UnanimousStrategy */
private $quorum;
Expand Down
5 changes: 4 additions & 1 deletion src/Symfony/Component/Lock/Tests/Store/AbstractStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@

namespace Symfony\Component\Lock\Tests\Store;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Lock\Exception\LockConflictedException;
use Symfony\Component\Lock\Key;
use Symfony\Component\Lock\StoreInterface;

/**
* @author Jérémy Derussé <jeremy@derusse.com>
*/
abstract class AbstractStoreTest extends \PHPUnit_Framework_TestCase
abstract class AbstractStoreTest extends TestCase
{
/**
* @return StoreInterface;
Expand Down 8000 Expand Up @@ -103,6 +104,8 @@ public function testSaveTwice()

$store->save($key);
$store->save($key);
// just asserts it don't throw an exception
$this->addToAssertionCount(1);

$store->delete($key);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Lock/Tests/Store/CombinedStoreTest.php
4BBE
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function testputOffExpirationAbortWhenQuorumCantBeMet()
}
}

public function testputOffExpirationIgnoreNonExpiringStorage()
public function testPutOffExpirationIgnoreNonExpiringStorage()
{
$store1 = $this->getMockBuilder(StoreInterface::class)->getMock();
$store2 = $this->getMockBuilder(StoreInterface::class)->getMock();
Expand All @@ -279,7 +279,7 @@ public function testputOffExpirationIgnoreNonExpiringStorage()
->method('canBeMet')
->willReturn(true);
$this->quorum
->expects($this->any())
->expects($this->once())
->method('isMet')
->with(2, 2)
->willReturn(true);
Expand Down
0