@@ 55-62 (lines=8) @@ | ||
52 | ->getMock(); |
|
53 | } |
|
54 | ||
55 | public function testCheckMasterSlaveConnectionSuccessful() |
|
56 | { |
|
57 | $this->masterSlaveConnection->method('ping')->willReturnOnConsecutiveCalls(true, true); |
|
58 | ||
59 | $actual = (new CheckConnection($this->masterSlaveConnection))->check(); |
|
60 | ||
61 | self::assertInstanceOf(Success::class, $actual); |
|
62 | } |
|
63 | ||
64 | public function testCheckMasterSlaveConnectionFailedFirstPing() |
|
65 | { |
|
@@ 64-71 (lines=8) @@ | ||
61 | self::assertInstanceOf(Success::class, $actual); |
|
62 | } |
|
63 | ||
64 | public function testCheckMasterSlaveConnectionFailedFirstPing() |
|
65 | { |
|
66 | $this->masterSlaveConnection->method('ping')->willReturnOnConsecutiveCalls(false, true); |
|
67 | ||
68 | $actual = (new CheckConnection($this->masterSlaveConnection))->check(); |
|
69 | ||
70 | self::assertInstanceOf(Failure::class, $actual); |
|
71 | } |
|
72 | ||
73 | public function testCheckMasterSlaveConnectionFailedSecondPing() |
|
74 | { |
|
@@ 73-80 (lines=8) @@ | ||
70 | self::assertInstanceOf(Failure::class, $actual); |
|
71 | } |
|
72 | ||
73 | public function testCheckMasterSlaveConnectionFailedSecondPing() |
|
74 | { |
|
75 | $this->masterSlaveConnection->method('ping')->willReturnOnConsecutiveCalls(true, false); |
|
76 | ||
77 | $actual = (new CheckConnection($this->masterSlaveConnection))->check(); |
|
78 | ||
79 | self::assertInstanceOf(Failure::class, $actual); |
|
80 | } |
|
81 | ||
82 | public function testCheckConnectionSuccessful() |
|
83 | { |