-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create a base test class that extends TripalTestCase #135
Comments
i think i understand this. the TestCase class is a stub that gets installed and bootstrapped. So when new Tests are created, you extend TestCase instead of TripalTestCase so you can have methods available in all your tests. Is that accurate? Seems like a good idea. The naming seems off. (test case vs tripal test case) what does |
I think an example will clarify. See this PR: statonlab/tripal_hq#94 For completeness, the TestCase.php class is auto loaded in composer.json using psr-4 standards. Does that help at all? |
Your explanation is in-line with what I was thinking above. My two concerns still stand.
|
Therefore, there will be no more mentions of TripalTestCase except in the new TestCase class. In other words, the user shouldn't care about anything but TestCase. |
ok thanks for clarifying that point, sounds good to me. We should probably make a note in the docs about old tests extending |
Sure! We have to make this a 2.0 feature otherwise the make:test will be breaking change. |
OR we can make |
By creating a
TestCase
class in thetests
folder that extends the TripalTestCase, we can allow users to add custom methods that all tests can inherit. Here is an example:This class allows all tests to create custom and random user accounts.
The tests themselves can then utilize this by simply extending
TestCase
instead ofTripalTestCase
:The text was updated successfully, but these errors were encountered: