Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit18b0da7

Browse files
Update unit test assertions.
Our tests have a ton of instances where we do something like:```php$this->assert(TRUE === $this->redis->command1());$this->assert($this->redis->command2() === 42);```Which should be written like this:```php$this->assertTrue($this->command1());$this->assertEquals(42, $this->command2());```Additionally it changes some assertions to use more relevant assertionslike `assertInArray` rather than `assertTrue(in_array())`.* Add `assertEqualsCanonicalizing` assertion similar to what PHPUnit has.* Add `assertStringContains` helper assertion.
1 parentb88e72b commit18b0da7

File tree

3 files changed

+1598
-1525
lines changed

3 files changed

+1598
-1525
lines changed

‎tests/RedisClusterTest.php‎

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,39 @@ class Redis_Cluster_Test extends Redis_Test {
2727
* RedisCluster class doesn't implement specialized (non-redis) commands
2828
* such as sortAsc, or sortDesc and other commands such as SELECT are
2929
* simply invalid in Redis Cluster */
30-
publicfunctiontestSortAsc() {return$this->markTestSkipped(); }
31-
publicfunctiontestSortDesc() {return$this->markTestSkipped(); }
32-
publicfunctiontestWait() {return$this->markTestSkipped(); }
33-
publicfunctiontestSelect() {return$this->markTestSkipped(); }
34-
publicfunctiontestReconnectSelect() {return$this->markTestSkipped(); }
35-
publicfunctiontestMultipleConnect() {return$this->markTestSkipped(); }
36-
publicfunctiontestDoublePipeNoOp() {return$this->markTestSkipped(); }
37-
publicfunctiontestSwapDB() {return$this->markTestSkipped(); }
38-
publicfunctiontestConnectException() {return$this->markTestSkipped(); }
39-
publicfunctiontestTlsConnect() {return$this->markTestSkipped(); }
40-
publicfunctiontestReset() {return$this->markTestSkipped(); }
41-
publicfunctiontestInvalidAuthArgs() {return$this->markTestSkipped(); }
42-
publicfunctiontestScanErrors() {return$this->markTestSkipped(); }
30+
publicfunctiontestPipelinePublish() {$this->markTestSkipped(); }
31+
publicfunctiontestSortAsc() {$this->markTestSkipped(); }
32+
publicfunctiontestSortDesc() {$this->markTestSkipped(); }
33+
publicfunctiontestWait() {$this->markTestSkipped(); }
34+
publicfunctiontestSelect() {$this->markTestSkipped(); }
35+
publicfunctiontestReconnectSelect() {$this->markTestSkipped(); }
36+
publicfunctiontestMultipleConnect() {$this->markTestSkipped(); }
37+
publicfunctiontestDoublePipeNoOp() {$this->markTestSkipped(); }
38+
publicfunctiontestSwapDB() {$this->markTestSkipped(); }
39+
publicfunctiontestConnectException() {$this->markTestSkipped(); }
40+
publicfunctiontestTlsConnect() {$this->markTestSkipped(); }
41+
publicfunctiontestReset() {$this->markTestSkipped(); }
42+
publicfunctiontestInvalidAuthArgs() {$this->markTestSkipped(); }
43+
publicfunctiontestScanErrors() {$this->markTestSkipped(); }
4344

4445
/* These 'directed node' commands work differently in RedisCluster */
45-
publicfunctiontestConfig() {return$this->markTestSkipped(); }
46-
publicfunctiontestFlushDB() {return$this->markTestSkipped(); }
47-
publicfunctiontestFunction() {return$this->markTestSkipped(); }
46+
publicfunctiontestConfig() {$this->markTestSkipped(); }
47+
publicfunctiontestFlushDB() {$this->markTestSkipped(); }
48+
publicfunctiontestFunction() {$this->markTestSkipped(); }
4849

4950
/* Session locking feature is currently not supported in in context of Redis Cluster.
5051
The biggest issue for this is the distribution nature of Redis cluster */
51-
publicfunctiontestSession_lockKeyCorrect() {return$this->markTestSkipped(); }
52-
publicfunctiontestSession_lockingDisabledByDefault() {return$this->markTestSkipped(); }
53-
publicfunctiontestSession_lockReleasedOnClose() {return$this->markTestSkipped(); }
54-
publicfunctiontestSession_ttlMaxExecutionTime() {return$this->markTestSkipped(); }
55-
publicfunctiontestSession_ttlLockExpire() {return$this->markTestSkipped(); }
56-
publicfunctiontestSession_lockHoldCheckBeforeWrite_otherProcessHasLock() {return$this->markTestSkipped(); }
57-
publicfunctiontestSession_lockHoldCheckBeforeWrite_nobodyHasLock() {return$this->markTestSkipped(); }
58-
publicfunctiontestSession_correctLockRetryCount() {return$this->markTestSkipped(); }
59-
publicfunctiontestSession_defaultLockRetryCount() {return$this->markTestSkipped(); }
60-
publicfunctiontestSession_noUnlockOfOtherProcess() {return$this->markTestSkipped(); }
61-
publicfunctiontestSession_lockWaitTime() {return$this->markTestSkipped(); }
52+
publicfunctiontestSession_lockKeyCorrect() {$this->markTestSkipped(); }
53+
publicfunctiontestSession_lockingDisabledByDefault() {$this->markTestSkipped(); }
54+
publicfunctiontestSession_lockReleasedOnClose() {$this->markTestSkipped(); }
55+
publicfunctiontestSession_ttlMaxExecutionTime() {$this->markTestSkipped(); }
56+
publicfunctiontestSession_ttlLockExpire() {$this->markTestSkipped(); }
57+
publicfunctiontestSession_lockHoldCheckBeforeWrite_otherProcessHasLock() {$this->markTestSkipped(); }
58+
publicfunctiontestSession_lockHoldCheckBeforeWrite_nobodyHasLock() {$this->markTestSkipped(); }
59+
publicfunctiontestSession_correctLockRetryCount() {$this->markTestSkipped(); }
60+
publicfunctiontestSession_defaultLockRetryCount() {$this->markTestSkipped(); }
61+
publicfunctiontestSession_noUnlockOfOtherProcess() {$this->markTestSkipped(); }
62+
publicfunctiontestSession_lockWaitTime() {$this->markTestSkipped(); }
6263

6364
/* Load our seeds on construction */
6465
publicfunction__construct($str_host,$i_port,$str_auth) {
@@ -692,7 +693,7 @@ public function testReplyLiteral() {
692693
the command to a specific node. */
693694
publicfunctiontestAcl() {
694695
if ( !$this->minVersionCheck("6.0"))
695-
return$this->markTestSkipped();
696+
$this->markTestSkipped();
696697

697698
$this->assertInArray('default',$this->redis->acl('foo','USERS'));
698699
}
@@ -702,9 +703,9 @@ public function testSession()
702703
@ini_set('session.save_handler','rediscluster');
703704
@ini_set('session.save_path',$this->sessionSavePath() .'&failover=error');
704705

705-
if (!@session_start()) {
706-
return$this->markTestSkipped();
707-
}
706+
if (!@session_start())
707+
$this->markTestSkipped();
708+
708709
session_write_close();
709710

710711
$this->assertKeyExists($this->sessionPrefix() .session_id());

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp