diff --git a/tests/phpunit/classes/AccessTest.class.php b/tests/phpunit/classes/AccessTest.class.php new file mode 100644 index 0000000000..cdbcd4638c --- /dev/null +++ b/tests/phpunit/classes/AccessTest.class.php @@ -0,0 +1,105 @@ +object = new Access; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * Generated from @assert () !== null. + * + * @covers Access::all + */ + public function testAll() + { + $this->assertNotSame( + null, + Access::all() + ); + } + + /** + * Generated from @assert () === null. + * + * @covers Access::forbidden + */ + public function testForbidden() + { + $this->assertSame( + null, + Access::forbidden() + ); + } + + /** + * Generated from @assert () === false. + * + * @covers Access::is_token_valid + */ + public function testIs_token_valid() + { + $this->assertSame( + false, + $this->object->is_token_valid() + ); + } + + /** + * Generated from @assert () !== null. + * + * @covers Access::get_session_token + */ + public function testGet_session_token() + { + $this->assertNotSame( + null, + $this->object->get_session_token() + ); + } + + /** + * Generated from @assert () === false. + * + * @covers Access::authorize + */ + public function testAuthorize() + { + $this->assertSame( + false, + $this->object->authorize() + ); + } + + /** + * @covers Access::get_token + * @todo Implement testGet_token(). + */ + public function testGet_token() + { + // Remove the following lines when you implement this test. + $this->markTestIncomplete( + 'This test has not been implemented yet.' + ); + } +} diff --git a/tests/phpunit/classes/AccessTokenTest.class.php b/tests/phpunit/classes/AccessTokenTest.class.php index 22eccb3eb0..eedac06d9c 100644 --- a/tests/phpunit/classes/AccessTokenTest.class.php +++ b/tests/phpunit/classes/AccessTokenTest.class.php @@ -1,6 +1,6 @@ markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertNotSame( + null, + AccessToken::empty_token() ); } /** + * Generated from @assert ('') !== null. + * * @covers AccessToken::parse - * @todo Implement testParse(). */ public function testParse() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertNotSame( + null, + AccessToken::parse('') ); } /** + * Generated from @assert (base64_encode('a/b')) !== null. + * + * @covers AccessToken::parse + */ + public function testParse2() + { + $this->assertNotSame( + null, + AccessToken::parse(base64_encode('a/b')) + ); + } + + /** + * Generated from @assert (base64_encode('a/b/c')) !== null. + * + * @covers AccessToken::parse + */ + public function testParse3() + { + $this->assertNotSame( + null, + AccessToken::parse(base64_encode('a/b/c')) + ); + } + + /** + * Generated from @assert (0, 0, 'a') !== null. + * * @covers AccessToken::create - * @todo Implement testCreate(). */ public function testCreate() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertNotSame( + null, + AccessToken::create(0, 0, 'a') ); } /** + * Generated from @assert () > 0. + * * @covers AccessToken::get_id - * @todo Implement testGet_id(). */ public function testGet_id() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertGreaterThan( + 0, + $this->object->get_id() ); } /** + * Generated from @assert () > 0. + * * @covers AccessToken::get_user_id - * @todo Implement testGet_user_id(). */ public function testGet_user_id() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertGreaterThan( + 0, + $this->object->get_user_id() ); } /** + * Generated from @assert () !== null. + * * @covers AccessToken::get_key - * @todo Implement testGet_key(). */ public function testGet_key() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertNotSame( + null, + $this->object->get_key() ); } /** + * Generated from @assert () === true. + * * @covers AccessToken::is_empty - * @todo Implement testIs_empty(). */ public function testIs_empty() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertSame( + true, + $this->object->is_empty() ); } /** + * Generated from @assert () === false. + * * @covers AccessToken::is_valid - * @todo Implement testIs_valid(). */ public function testIs_valid() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertSame( + false, + $this->object->is_valid() ); } /** + * Generated from @assert () !== null. + * * @covers AccessToken::__toString - * @todo Implement test__toString(). */ public function test__toString() { - // Remove the following lines when you implement this test. - $this->markTestIncomplete( - 'This test has not been implemented yet.' + $this->assertNotSame( + null, + $this->object->__toString() ); } } diff --git a/tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php b/tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php new file mode 100644 index 0000000000..77132b0ee0 --- /dev/null +++ b/tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php @@ -0,0 +1,41 @@ +object = new Accessurleditcoursestourl; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * Generated from @assert () === false. + * + * @covers Accessurleditcoursestourl::search_courses + */ + public function testSearch_courses() + { + $this->assertSame( + false, + $this->object->search_courses() + ); + } +} diff --git a/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php b/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php new file mode 100644 index 0000000000..9e27393b32 --- /dev/null +++ b/tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php @@ -0,0 +1,41 @@ +object = new Accessurleditsessionstourl; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * Generated from @assert () === false. + * + * @covers Accessurleditsessionstourl::search_sessions + */ + public function testSearch_sessions() + { + $this->assertSame( + false, + $this->object->search_sessions() + ); + } +} diff --git a/tests/phpunit/classes/AccessurledituserstourlTest.lib.php b/tests/phpunit/classes/AccessurledituserstourlTest.lib.php new file mode 100644 index 0000000000..f6d7c59914 --- /dev/null +++ b/tests/phpunit/classes/AccessurledituserstourlTest.lib.php @@ -0,0 +1,41 @@ +object = new Accessurledituserstourl; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * Generated from @assert () === false. + * + * @covers Accessurledituserstourl::search_users + */ + public function testSearch_users() + { + $this->assertSame( + false, + $this->object->search_users() + ); + } +} diff --git a/tests/phpunit/classes/AddCourseToSessionTest.lib.php b/tests/phpunit/classes/AddCourseToSessionTest.lib.php new file mode 100644 index 0000000000..b4feedab28 --- /dev/null +++ b/tests/phpunit/classes/AddCourseToSessionTest.lib.php @@ -0,0 +1,67 @@ +object = new AddCourseToSession; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * Generated from @assert () !== null. + * + * @covers AddCourseToSession::search_courses + */ + public function testSearch_courses() + { + $this->assertNotSame( + null, + $this->object->search_courses() + ); + } + + /** + * Generated from @assert ('abc', 'single') !== null. + * + * @covers AddCourseToSession::search_courses + */ + public function testSearch_courses2() + { + $this->assertNotSame( + null, + $this->object->search_courses('abc', 'single') + ); + } + + /** + * Generated from @assert ('abc', 'multiple') !== null. + * + * @covers AddCourseToSession::search_courses + */ + public function testSearch_courses3() + { + $this->assertNotSame( + null, + $this->object->search_courses('abc', 'multiple') + ); + } +} diff --git a/tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.php b/tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.php new file mode 100644 index 0000000000..6be6eca1a8 --- /dev/null +++ b/tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.php @@ -0,0 +1,54 @@ +object = new AddManySessionToCategoryFunctions; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * Generated from @assert () !== ''. + * + * @covers AddManySessionToCategoryFunctions::search_courses + */ + public function testSearch_courses() + { + $this->assertNotSame( + '', + $this->object->search_courses() + ); + } + + /** + * Generated from @assert ('abc','single') !== ''. + * + * @covers AddManySessionToCategoryFunctions::search_courses + */ + public function testSearch_courses2() + { + $this->assertNotSame( + '', + $this->object->search_courses('abc','single') + ); + } +}