Skip to content
This repository was archived by the owner on Dec 11, 2018. It is now read-only.

Commit 4ebf4ca

Browse files
committed
Test fixes
1 parent 25f04d5 commit 4ebf4ca

File tree

4 files changed

+11
-34
lines changed

4 files changed

+11
-34
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<logging>
1515
<log type="tap" target="php://stdout" logIncompleteSkipped="true"/>
16-
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
16+
<!-- log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/ -->
1717
</logging>
1818

1919
<filter>

tests/ConfigTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
namespace Wikimedia\IEGReview;
2525

2626
/**
27+
* @coversDefaultClass \Wikimedia\IEGReview\Config
2728
* @author Bryan Davis <bd808@wikimedia.org>
2829
* @copyright © 2014 Bryan Davis, Wikimedia Foundation and contributors.
2930
*/

tests/FormTest.php

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@
2424
namespace Wikimedia\IEGReview;
2525

2626
/**
27+
* @coversDefaultClass \Wikimedia\IEGReview\Form
28+
* @uses \Wikimedia\IEGReview\Form
2729
* @author Bryan Davis <bd808@wikimedia.org>
2830
* @copyright © 2014 Bryan Davis, Wikimedia Foundation and contributors.
2931
*/
3032
class FormTest extends \PHPUnit_Framework_TestCase {
3133

32-
/**
33-
* @covers Form
34-
*/
3534
public function testRequired () {
3635
$form = new Form();
3736
$form->expectString( 'foo', array( 'required' => true ) );
@@ -43,9 +42,6 @@ public function testRequired () {
4342
$this->assertContains( 'foo', $form->getErrors() );
4443
}
4544

46-
/**
47-
* @covers Form
48-
*/
4945
public function testDefaultWhenEmpty () {
5046
$form = new Form();
5147
$form->expectString( 'foo', array( 'default' => 'bar' ) );
@@ -57,9 +53,6 @@ public function testDefaultWhenEmpty () {
5753
$this->assertNotContains( 'foo', $form->getErrors() );
5854
}
5955

60-
/**
61-
* @covers Form
62-
*/
6356
public function testNotInArray () {
6457
$form = new Form();
6558
$form->expectInArray( 'foo', array( 'bar' ), array( 'required' => true ) );
@@ -71,9 +64,6 @@ public function testNotInArray () {
7164
$this->assertContains( 'foo', $form->getErrors() );
7265
}
7366

74-
/**
75-
* @covers Form
76-
*/
7767
public function testInArray () {
7868
$_POST['foo'] = 'bar';
7969
$form = new Form();
@@ -86,9 +76,6 @@ public function testInArray () {
8676
$this->assertNotContains( 'foo', $form->getErrors() );
8777
}
8878

89-
/**
90-
* @covers Form
91-
*/
9279
public function testNotInArrayNotRequired () {
9380
unset( $_POST['foo'] );
9481
$form = new Form();
@@ -101,9 +88,6 @@ public function testNotInArrayNotRequired () {
10188
$this->assertNotContains( 'foo', $form->getErrors() );
10289
}
10390

104-
/**
105-
* @covers Form
106-
*/
10791
public function testEncodeBasic () {
10892
$input = array(
10993
'foo' => 1,
@@ -114,9 +98,6 @@ public function testEncodeBasic () {
11498
$this->assertEquals( 'foo=1&bar=this%3Dthat&baz=tom+%26+jerry', $output );
11599
}
116100

117-
/**
118-
* @covers Form
119-
*/
120101
public function testEncodeArray () {
121102
$input = array(
122103
'foo' => array( 'a', 'b', 'c' ),
@@ -127,9 +108,6 @@ public function testEncodeArray () {
127108
'foo=a&foo=b&foo=c&bar%5B%5D=1&bar%5B%5D=2&bar%5B%5D=3', $output );
128109
}
129110

130-
/**
131-
* @covers Form
132-
*/
133111
public function testQsMerge () {
134112
$_GET['foo'] = 1;
135113
$_GET['bar'] = 'this=that';
@@ -142,9 +120,6 @@ public function testQsMerge () {
142120
$this->assertEquals( 'foo=2&bar=this%3Dthat&baz=tom+%26+jerry&xyzzy=grue', $output );
143121
}
144122

145-
/**
146-
* @covers Form
147-
*/
148123
public function testQsRemove () {
149124
$_GET['foo'] = 1;
150125
$_GET['bar'] = 'this=that';
@@ -156,5 +131,4 @@ public function testQsRemove () {
156131
$output = Form::qsRemove( array( 'bar' ) );
157132
$this->assertEquals( 'foo=1&baz=tom+%26+jerry', $output );
158133
}
159-
160-
} //end FormTest
134+
}

tests/PasswordTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
namespace Wikimedia\IEGReview;
2525

2626
/**
27+
* @coversDefaultClass \Wikimedia\IEGReview\Password
28+
* @uses \Wikimedia\IEGReview\Password
2729
* @author Bryan Davis <bd808@wikimedia.org>
2830
* @copyright © 2014 Bryan Davis, Wikimedia Foundation and contributors.
2931
*/
3032
class PasswordTest extends \PHPUnit_Framework_TestCase {
3133

3234
/**
33-
* @covers Password::encodePassword
34-
* @covers Password::blowfishSalt
35+
* @covers ::encodePassword
36+
* @covers ::blowfishSalt
3537
*/
3638
public function testUniqueEncoding() {
3739
$enc = Password::encodePassword( 'password' );
@@ -40,7 +42,7 @@ public function testUniqueEncoding() {
4042
}
4143

4244
/**
43-
* @covers Password::comparePasswordToHash
45+
* @covers ::comparePasswordToHash
4446
*/
4547
public function testComparePasswordToHash() {
4648
$enc = Password::encodePassword( 'password' );
@@ -49,7 +51,7 @@ public function testComparePasswordToHash() {
4951
}
5052

5153
/**
52-
* @covers Password::randomPassword
54+
* @covers ::randomPassword
5355
*/
5456
public function testRandomPassword() {
5557
// I've always wondered how to write a phpunit test to decide if random is

0 commit comments

Comments
 (0)