Loading external/composer.json +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ "emuse/behat-html-formatter": "^0.1", "fabpot/goutte": "^3.2", "guzzlehttp/guzzle": "^6.3.0", "phpunit/phpunit": "^4.5" "phpunit/phpunit": "^6.0" }, "autoload": { Loading htdocs/lib/phpunit.php +1 −1 Original line number Diff line number Diff line Loading @@ -137,7 +137,7 @@ class UnitTestBootstrap { * mocking events (or just ignoring them) * mocking the file system */ class MaharaUnitTest extends PHPUnit_Framework_TestCase { class MaharaUnitTest extends PHPUnit\Framework\TestCase { /** @var array list of common last names */ public $lastnames = array( Loading htdocs/lib/tests/phpunit/ArtefactTest.php +3 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,9 @@ class ArtefactTest extends MaharaUnitTest { $this->fail("Artefact wasn't deleted properly!"); } catch (Exception $e) {} $fromdb = get_field('artefact', 'artefacttype', 'id', $todeleteid); $this->assertEquals(null, $fromdb); } /** Loading htdocs/lib/tests/phpunit/ViewTest.php +3 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,9 @@ class ViewTest extends MaharaUnitTest { $this->fail("View wasn't deleted properly!"); } catch (Exception $e) {} $fromdb = get_field('view', 'type', 'id', $todeleteid); $this->assertEquals(null, $fromdb); } public function testView_get_artefact_instances() { Loading htdocs/webservice/tests/phpunit/WebServiceTestBase.class.php +4 −3 Original line number Diff line number Diff line Loading @@ -143,10 +143,11 @@ class WebServiceTestBase extends MaharaUnitTest { // construct a test service from all available functions $dbservice = get_record('external_services', 'name', $this->servicename); if (empty($dbservice)) { $service = array('name' => $this->servicename, 'tokenusers' => 0, 'restrictedusers' => 0, 'enabled' => 1, 'component' => 'webservice', 'ctime' => db_format_timestamp(time())); $service = array('name' => $this->servicename, 'tokenusers' => 1, 'restrictedusers' => 0, 'enabled' => 1, 'component' => 'webservice', 'ctime' => db_format_timestamp(time())); insert_record('external_services', $service); $dbservice = get_record('external_services', 'name', $this->servicename); } $dbfunctions = get_records_array('external_functions', null, null, 'name'); foreach ($dbfunctions as $function) { $sfexists = record_exists('external_services_functions', 'externalserviceid', $dbservice->id, 'functionname', $function->name); Loading @@ -155,6 +156,7 @@ class WebServiceTestBase extends MaharaUnitTest { insert_record('external_services_functions', $service_function); $dbservice->mtime = db_format_timestamp(time()); update_record('external_services', $dbservice); $sfexists = record_exists('external_services_functions', 'externalserviceid', $dbservice->id, 'functionname', $function->name); } } Loading @@ -176,11 +178,10 @@ class WebServiceTestBase extends MaharaUnitTest { $this->consumer = (object) $store->getConsumer($this->consumer_key, $dbuser->id); // Now do the request and access token $this->request_token = $store->addConsumerRequestToken($this->consumer_key, array()); $this->request_token = $store->addConsumerRequestToken($this->consumer_key, array('token_ttl' => 50000)); // authorise $verifier = $store->authorizeConsumerRequestToken($this->request_token['token'], $dbuser->id, 'localhost'); // exchange access token $options = array(); $options['verifier'] = $verifier; Loading Loading
external/composer.json +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ "emuse/behat-html-formatter": "^0.1", "fabpot/goutte": "^3.2", "guzzlehttp/guzzle": "^6.3.0", "phpunit/phpunit": "^4.5" "phpunit/phpunit": "^6.0" }, "autoload": { Loading
htdocs/lib/phpunit.php +1 −1 Original line number Diff line number Diff line Loading @@ -137,7 +137,7 @@ class UnitTestBootstrap { * mocking events (or just ignoring them) * mocking the file system */ class MaharaUnitTest extends PHPUnit_Framework_TestCase { class MaharaUnitTest extends PHPUnit\Framework\TestCase { /** @var array list of common last names */ public $lastnames = array( Loading
htdocs/lib/tests/phpunit/ArtefactTest.php +3 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,9 @@ class ArtefactTest extends MaharaUnitTest { $this->fail("Artefact wasn't deleted properly!"); } catch (Exception $e) {} $fromdb = get_field('artefact', 'artefacttype', 'id', $todeleteid); $this->assertEquals(null, $fromdb); } /** Loading
htdocs/lib/tests/phpunit/ViewTest.php +3 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,9 @@ class ViewTest extends MaharaUnitTest { $this->fail("View wasn't deleted properly!"); } catch (Exception $e) {} $fromdb = get_field('view', 'type', 'id', $todeleteid); $this->assertEquals(null, $fromdb); } public function testView_get_artefact_instances() { Loading
htdocs/webservice/tests/phpunit/WebServiceTestBase.class.php +4 −3 Original line number Diff line number Diff line Loading @@ -143,10 +143,11 @@ class WebServiceTestBase extends MaharaUnitTest { // construct a test service from all available functions $dbservice = get_record('external_services', 'name', $this->servicename); if (empty($dbservice)) { $service = array('name' => $this->servicename, 'tokenusers' => 0, 'restrictedusers' => 0, 'enabled' => 1, 'component' => 'webservice', 'ctime' => db_format_timestamp(time())); $service = array('name' => $this->servicename, 'tokenusers' => 1, 'restrictedusers' => 0, 'enabled' => 1, 'component' => 'webservice', 'ctime' => db_format_timestamp(time())); insert_record('external_services', $service); $dbservice = get_record('external_services', 'name', $this->servicename); } $dbfunctions = get_records_array('external_functions', null, null, 'name'); foreach ($dbfunctions as $function) { $sfexists = record_exists('external_services_functions', 'externalserviceid', $dbservice->id, 'functionname', $function->name); Loading @@ -155,6 +156,7 @@ class WebServiceTestBase extends MaharaUnitTest { insert_record('external_services_functions', $service_function); $dbservice->mtime = db_format_timestamp(time()); update_record('external_services', $dbservice); $sfexists = record_exists('external_services_functions', 'externalserviceid', $dbservice->id, 'functionname', $function->name); } } Loading @@ -176,11 +178,10 @@ class WebServiceTestBase extends MaharaUnitTest { $this->consumer = (object) $store->getConsumer($this->consumer_key, $dbuser->id); // Now do the request and access token $this->request_token = $store->addConsumerRequestToken($this->consumer_key, array()); $this->request_token = $store->addConsumerRequestToken($this->consumer_key, array('token_ttl' => 50000)); // authorise $verifier = $store->authorizeConsumerRequestToken($this->request_token['token'], $dbuser->id, 'localhost'); // exchange access token $options = array(); $options['verifier'] = $verifier; Loading