Browse Source

Minor: Added test classes for a few classes

Yannick Warnier 12 years ago
parent
commit
22be92232c

+ 105 - 0
tests/phpunit/classes/AccessTest.class.php

@@ -0,0 +1,105 @@
+<?php
+/**
+ * Generated by PHPUnit_SkeletonGenerator on 2013-02-17 at 00:36:52.
+ */
+class AccessTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Access
+     */
+    protected $object;
+
+    /**
+     * Sets up the fixture, for example, opens a network connection.
+     * This method is called before a test is executed.
+     */
+    protected function setUp()
+    {
+        $this->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.'
+        );
+    }
+}

+ 72 - 37
tests/phpunit/classes/AccessTokenTest.class.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * Generated by PHPUnit_SkeletonGenerator on 2012-10-01 at 14:44:08.
+ * Generated by PHPUnit_SkeletonGenerator on 2013-02-17 at 00:37:09.
  */
 class AccessTokenTest extends PHPUnit_Framework_TestCase
 {
@@ -27,110 +27,145 @@ class AccessTokenTest extends PHPUnit_Framework_TestCase
     }
 
     /**
+     * Generated from @assert () !== null.
+     *
      * @covers AccessToken::empty_token
-     * @todo   Implement testEmpty_token().
      */
     public function testEmpty_token()
     {
-        // Remove the following lines when you implement this test.
-        $this->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()
         );
     }
 }

+ 41 - 0
tests/phpunit/classes/AccessurleditcoursestourlTest.lib.php

@@ -0,0 +1,41 @@
+<?php
+/**
+ * Generated by PHPUnit_SkeletonGenerator on 2013-02-17 at 00:38:16.
+ */
+class AccessurleditcoursestourlTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Accessurleditcoursestourl
+     */
+    protected $object;
+
+    /**
+     * Sets up the fixture, for example, opens a network connection.
+     * This method is called before a test is executed.
+     */
+    protected function setUp()
+    {
+        $this->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()
+        );
+    }
+}

+ 41 - 0
tests/phpunit/classes/AccessurleditsessionstourlTest.lib.php

@@ -0,0 +1,41 @@
+<?php
+/**
+ * Generated by PHPUnit_SkeletonGenerator on 2013-02-17 at 00:38:50.
+ */
+class AccessurleditsessionstourlTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Accessurleditsessionstourl
+     */
+    protected $object;
+
+    /**
+     * Sets up the fixture, for example, opens a network connection.
+     * This method is called before a test is executed.
+     */
+    protected function setUp()
+    {
+        $this->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()
+        );
+    }
+}

+ 41 - 0
tests/phpunit/classes/AccessurledituserstourlTest.lib.php

@@ -0,0 +1,41 @@
+<?php
+/**
+ * Generated by PHPUnit_SkeletonGenerator on 2013-02-17 at 00:39:52.
+ */
+class AccessurledituserstourlTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Accessurledituserstourl
+     */
+    protected $object;
+
+    /**
+     * Sets up the fixture, for example, opens a network connection.
+     * This method is called before a test is executed.
+     */
+    protected function setUp()
+    {
+        $this->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()
+        );
+    }
+}

+ 67 - 0
tests/phpunit/classes/AddCourseToSessionTest.lib.php

@@ -0,0 +1,67 @@
+<?php
+/**
+ * Generated by PHPUnit_SkeletonGenerator on 2013-02-17 at 00:43:47.
+ */
+class AddCourseToSessionTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var AddCourseToSession
+     */
+    protected $object;
+
+    /**
+     * Sets up the fixture, for example, opens a network connection.
+     * This method is called before a test is executed.
+     */
+    protected function setUp()
+    {
+        $this->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')
+        );
+    }
+}

+ 54 - 0
tests/phpunit/classes/AddManySessionToCategoryFunctionsTest.lib.php

@@ -0,0 +1,54 @@
+<?php
+/**
+ * Generated by PHPUnit_SkeletonGenerator on 2013-02-17 at 01:03:12.
+ */
+class AddManySessionToCategoryFunctionsTest extends PHPUnit_Framework_TestCase
+{
+    /**
+     * @var AddManySessionToCategoryFunctions
+     */
+    protected $object;
+
+    /**
+     * Sets up the fixture, for example, opens a network connection.
+     * This method is called before a test is executed.
+     */
+    protected function setUp()
+    {
+        $this->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')
+        );
+    }
+}