Skip to content

Commit ba4f6ba

Browse files
committed
MAGETWO-98151: Add support ZooKeeper locks
1 parent 9accdd4 commit ba4f6ba

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Framework\Lock\Test\Unit\Backend;
9+
10+
use Magento\Framework\Lock\Backend\Zookeeper as ZookeeperProvider;
11+
use PHPUnit\Framework\TestCase;
12+
use PHPUnit\Framework\MockObject\MockObject;
13+
14+
class ZookeeperTest extends TestCase
15+
{
16+
/**
17+
* @var \Zookeeper|MockObject
18+
*/
19+
private $zookeeperMock;
20+
21+
/**
22+
* @var ZookeeperProvider
23+
*/
24+
private $zookeeperProvider;
25+
26+
/**
27+
* @var string
28+
*/
29+
private $host = 'localhost:123';
30+
31+
/**
32+
* @var string
33+
*/
34+
private $path = '/some/path';
35+
36+
/**
37+
* @inheritdoc
38+
*/
39+
protected function setUp()
40+
{
41+
$this->zookeeperProvider = new ZookeeperProvider($this->host, '/some/path/');
42+
}
43+
44+
/**
45+
* @expectedException \Magento\Framework\Exception\RuntimeException
46+
* @expectedExceptionMessage The path needs to be a non-empty string.
47+
*/
48+
public function testConstructionWithException()
49+
{
50+
$this->zookeeperProvider = new ZookeeperProvider('some host', '');
51+
}
52+
53+
54+
}

0 commit comments

Comments
 (0)