-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API] 2020-05-25 Add api testsuite #6663
Conversation
This is failing Travis because of code formatting issues. If you run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some feedbacks.
@johnsaigle @kongtiaowang All comments are welcome but this is a draft PR I requested. It is not ready yet :)
modules/api/test/ApiTest.php
Outdated
|
||
|
||
namespace LORIS\api\Test; | ||
ini_set('memory_limit', '1024M'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed.
The testsuite will fail if something is wrong with memory limit and we will look at the issue globaly.
modules/api/test/ApiTest.php
Outdated
* | ||
* @category API | ||
* @package Tests | ||
* @subpackage Login |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change Login for integration maybe
modules/api/test/ApiTest.php
Outdated
|
||
require './vendor/autoload.php'; | ||
|
||
use PHPUnit\Framework\TestCase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed if you require LorisIntegrationTest.class.inc
modules/api/test/ApiTest.php
Outdated
{ | ||
$this->_base_uri = 'https://test-loris-dev.loris.ca/api/v0.0.3/'; | ||
$this->_client = new \GuzzleHttp\Client(['base_uri' => $this->_base_uri]); | ||
$response = $this->_client->request('POST', LORIS_URL, ['json' => ['username' => LORIS_USERNAME, 'password' => LORIS_PASSWORD]]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is LORIS_URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LORIS_USERNAME should be UnitTester
and LORIS_PASSWORD should be $this->validPassword
Right @kongtiaowang ?
3f0a3d1
to
54160f3
Compare
This branch is to be deleted. The new branch is #6671. |
@spell00 I think something may have gone wrong in the commit. 2000+ files seems like a lot |
fyi @johnsaigle you're seeing the commit necessary to rollback an unfortunate commit |
Creation of a test suite for the API