Index: trunk/phase3/tests/phpunit/includes/filerepo/StoreBatchTest.php |
— | — | @@ -54,8 +54,8 @@ |
55 | 55 | private function storecohort($fn, $infn, $otherfn, $fromrepo) { |
56 | 56 | $f = $this->storeit( $fn, $infn, 0 ); |
57 | 57 | $this->assertTrue( $f->isOK(), 'failed to store a new file' ); |
58 | | - $this->assertTrue( $f->failCount == 0, "counts wrong {$f->successCount} {$f->failCount}" ); |
59 | | - $this->assertTrue( $f->successCount == 1 , "counts wrong {$f->successCount} {$f->failCount}" ); |
| 58 | + $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); |
| 59 | + $this->assertEquals( $f->successCount, 1 , "counts wrong {$f->successCount} {$f->failCount}" ); |
60 | 60 | if ( $fromrepo ) { |
61 | 61 | $f = $this->storeit( "Other-$fn", $infn, FileRepo::OVERWRITE); |
62 | 62 | $infn = $f->value; |
— | — | @@ -63,18 +63,18 @@ |
64 | 64 | // This should work because we're allowed to overwrite |
65 | 65 | $f = $this->storeit( $fn, $infn, FileRepo::OVERWRITE ); |
66 | 66 | $this->assertTrue( $f->isOK(), 'We should be allowed to overwrite' ); |
67 | | - $this->assertTrue( $f->failCount == 0, "counts wrong {$f->successCount} {$f->failCount}" ); |
68 | | - $this->assertTrue( $f->successCount == 1 , "counts wrong {$f->successCount} {$f->failCount}" ); |
| 67 | + $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); |
| 68 | + $this->assertEquals( $f->successCount, 1 , "counts wrong {$f->successCount} {$f->failCount}" ); |
69 | 69 | // This should fail because we're overwriting. |
70 | 70 | $f = $this->storeit( $fn, $infn, 0 ); |
71 | 71 | $this->assertFalse( $f->isOK(), 'We should not be allowed to overwrite' ); |
72 | | - #$this->assertTrue( $f->failCount == 0, "counts wrong {$f->successCount} {$f->failCount}" ); |
73 | | - #$this->assertTrue( $f->successCount == 0 , "counts wrong {$f->successCount} {$f->failCount}" ); |
| 72 | + $this->assertEquals( $f->failCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); |
| 73 | + $this->assertEquals( $f->successCount, 0 , "counts wrong {$f->successCount} {$f->failCount}" ); |
74 | 74 | // This should succeed because we're overwriting the same content. |
75 | 75 | $f = $this->storeit( $fn, $infn, FileRepo::OVERWRITE_SAME ); |
76 | 76 | $this->assertTrue( $f->isOK(), 'We should be able to overwrite the same content' ); |
77 | | - $this->assertTrue( $f->failCount == 0, "counts wrong {$f->successCount} {$f->failCount}" ); |
78 | | - $this->assertTrue( $f->successCount == 1 , "counts wrong {$f->successCount} {$f->failCount}" ); |
| 77 | + $this->assertEquals( $f->failCount, 0, "counts wrong {$f->successCount} {$f->failCount}" ); |
| 78 | + $this->assertEquals( $f->successCount, 1 , "counts wrong {$f->successCount} {$f->failCount}" ); |
79 | 79 | // This should fail because we're overwriting different content. |
80 | 80 | if ( $fromrepo ) { |
81 | 81 | $f = $this->storeit( "Other-$fn", $otherfn, FileRepo::OVERWRITE); |
— | — | @@ -82,8 +82,8 @@ |
83 | 83 | } |
84 | 84 | $f = $this->storeit( $fn, $otherfn, FileRepo::OVERWRITE_SAME ); |
85 | 85 | $this->assertFalse( $f->isOK(), 'We should not be allowed to overwrite different content' ); |
86 | | - #$this->assertTrue( $f->failCount == 0, "counts wrong {$f->successCount} {$f->failCount}" ); |
87 | | - #$this->assertTrue( $f->successCount == 0 , "counts wrong {$f->successCount} {$f->failCount}" ); |
| 86 | + $this->assertEquals( $f->failCount, 1, "counts wrong {$f->successCount} {$f->failCount}" ); |
| 87 | + $this->assertEquals( $f->successCount, 0 , "counts wrong {$f->successCount} {$f->failCount}" ); |
88 | 88 | } |
89 | 89 | |
90 | 90 | public function teststore() { |