Skip to content
Browse files

Use module_setup instead of setup. Clean out useless tabs on empty li…

…nes.
  • Loading branch information...
1 parent 9ec7561 commit b4790be071e34480b3d5236bbf5a7cd339dcd143 @mikelietz mikelietz committed Mar 26, 2012
Showing with 24 additions and 24 deletions.
  1. +24 −24 units/test_bitmask.php
View
48 units/test_bitmask.php
@@ -6,7 +6,7 @@ class BitmaskTest extends UnitTestCase
{
- public function setup()
+ public function module_setup()
{
$this->access_names = array( 'read', 'edit', 'delete', 'create' );
$this->bitmask = new Bitmask($this->access_names);
@@ -17,7 +17,7 @@ public function test_constructor()
$mask = new Bitmask( array( 'dog', 'cat' ), 3 );
$this->assert_true( $mask->dog );
$this->assert_true( $mask->cat );
-
+
$mask = new Bitmask( array( 'dog', 'cat' ), '3' );
$this->assert_true( $mask->dog );
$this->assert_true( $mask->cat );
@@ -36,7 +36,7 @@ public function test_constructor()
$mask = new Bitmask( array( 'flags' ), 'flags' );
$this->assert_true( $mask->flags );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -45,39 +45,39 @@ public function test_constructor_invalid_first_argument()
$this->assert_exception('InvalidArgumentException');
$mask = new Bitmask( 'brute' );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
public function test_constructor_invalid_flag_name_full()
{
$mask = new Bitmask( array( 'full' ) );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
public function test_constructor_invalid_flag_name_value()
{
$mask = new Bitmask( array( 'value' ) );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
public function test_constructor_duplicate_flag_name()
{
$mask = new Bitmask( array( 'foo', 'foo' ) );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
public function test_constructor_non_string_flag_name()
{
$mask = new Bitmask( array( 1 ) );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -86,7 +86,7 @@ public function test_constructor_invalid_second_argument_nonexistent_flag_name()
$this->assert_exception('InvalidArgumentException');
$mask = new Bitmask( array( 'dog', 'cat' ), 'giraffe' );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -95,7 +95,7 @@ public function test_constructor_invalid_second_argument_flags()
$this->assert_exception('InvalidArgumentException');
$mask = new Bitmask( array( 'dog', 'cat' ), 'flags' );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -104,7 +104,7 @@ public function test_constructor_invalid_second_argument_array()
$this->assert_exception('InvalidArgumentException');
$mask = new Bitmask( array( 'dog', 'cat' ), array() );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -113,7 +113,7 @@ public function test_constructor_invalid_second_argument_int_too_small()
$this->assert_exception('InvalidArgumentException');
$mask = new Bitmask( array( 'dog', 'cat' ), -1 );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -146,7 +146,7 @@ public function test_write_by_name()
$this->bitmask->delete = false;
$this->assert_equal(8, $this->bitmask->value);
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -179,20 +179,20 @@ public function test_write_by_value()
$this->assert_false($this->bitmask->read);
$this->assert_true($this->bitmask->delete);
$this->assert_true($this->bitmask->edit);
-
+
$this->bitmask->value = 0;
$this->assert_false($this->bitmask->create);
$this->assert_false($this->bitmask->read);
$this->assert_false($this->bitmask->delete);
$this->assert_false($this->bitmask->edit);
-
+
$this->bitmask->value = '8';
$this->assert_true($this->bitmask->create);
$this->assert_false($this->bitmask->read);
$this->assert_false($this->bitmask->delete);
$this->assert_false($this->bitmask->edit);
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -201,7 +201,7 @@ public function test_write_by_value_array()
$this->assert_exception('InvalidArgumentException');
$this->bitmask->value = array();
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -210,7 +210,7 @@ public function test_write_by_value_int_too_small()
$this->assert_exception('InvalidArgumentException');
$this->bitmask->value = -1;
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -227,7 +227,7 @@ public function test_write_by_full()
$this->bitmask->full = false;
$this->assert_equal( 0, $this->bitmask->value );
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -244,7 +244,7 @@ public function test_write_by_array()
$this->assert_equal(9, $this->bitmask->value);
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -254,7 +254,7 @@ public function test_write_by_array_non_bool()
$mask = array( 1, 0, 0, 1 );
$this->bitmask->value = $mask;
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -264,7 +264,7 @@ public function test_write_by_array_too_short()
$mask = array( 1 );
$this->bitmask->value = $mask;
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -274,7 +274,7 @@ public function test_write_by_array_too_long()
$mask = array( 1, 0, 0, 1, 1 );
$this->bitmask->value = $mask;
}
-
+
/**
* @expectedException InvalidArgumentException
*/
@@ -288,7 +288,7 @@ public function test_get()
{
$this->assert_equal( $this->bitmask->full, 15 );
}
-
+
/**
* @expectedException InvalidArgumentException
*/

0 comments on commit b4790be

Please sign in to comment.
Something went wrong with that request. Please try again.