\seekquarry\yioop\testsSha1JavascriptTest

Used to test the Javascript implementation of the sha1 function.

Summary

Methods
Properties
Constants
setUp()
run()
tearDown()
__construct()
assertTrue()
assertFalse()
assertEqual()
assertNotEqual()
sha1TestCase()
$test_case_results
$test_objects
case_name
NUM_TEST_CASES
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

case_name

case_name

The suffix that all TestCase methods need to have to be called by run()

NUM_TEST_CASES

NUM_TEST_CASES

Number of test cases

Properties

$test_case_results

$test_case_results : 

Used to store the results for each test sub case

Type

$test_objects

$test_objects : array

Used to hold objects to be used in tests

Type

array

Methods

setUp()

setUp() 

This method is called before each test case is run to set up the given test case

run()

run() : array

Execute each of the test cases of this unit test and return the results

Returns

array —

test case results

tearDown()

tearDown() 

This method is called after each test case is run to clean up

__construct()

__construct() 

Contructor should be overriden to do any set up that occurs before and test cases

assertTrue()

assertTrue(mixed  $x, string  $description = "") 

Checks that $x can coerced to true, the result of the test is added to $this->test_case_results

Parameters

mixed $x

item to check

string $description

information about this test subcase

assertFalse()

assertFalse(mixed  $x, string  $description = "") 

Checks that $x can coerced to false, the result of the test is added to $this->test_case_results

Parameters

mixed $x

item to check

string $description

information about this test subcase

assertEqual()

assertEqual(mixed  $x, mixed  $y, string  $description = "") 

Checks that $x and $y are the same, the result of the test is added to $this->test_case_results

Parameters

mixed $x

a first item to compare

mixed $y

a second item to compare

string $description

information about this test subcase

assertNotEqual()

assertNotEqual(mixed  $x, mixed  $y, string  $description = "") 

Checks that $x and $y are not the same, the result of the test is added to $this->test_case_results

Parameters

mixed $x

a first item to compare

mixed $y

a second item to compare

string $description

information about this test subcase

sha1TestCase()

sha1TestCase() 

This test case generates random strings and computes their sha1 hash in PHP-land. It then sends the strings and their hashes to Javascript land to test if the Javascript implementation of Sha1 gets the same answer.