Skip to content
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

325 improve testsuite simplify testing #3027

Merged

Conversation

@carakas
Copy link
Member

carakas commented Jan 30, 2020

Type

  • Enhancement

Resolves the following issues

Based on #3025

Pull request description

Add some extra test methods to make it easier to write tests in Fork and easier to read the tests
Some cleanup and some Data fixtures

All the tests are now running in a sandbox so it takes a little longer but the issue with backend constants being available in frontend tests is solved now.

struggled a bit fixing the coverage reports in scrutinizer but the coverage should be more accurate now and it should fluctuate less

carakas added 30 commits Jan 23, 2020
@carakas carakas changed the title 325 improve testsuite simplify testing WIP:325 improve testsuite simplify testing Feb 4, 2020
@carakas carakas force-pushed the justcarakas:325-improve-testsuite-simplify-testing branch from bc284a2 to 225207b Feb 4, 2020
@carakas carakas changed the title WIP:325 improve testsuite simplify testing 325 improve testsuite simplify testing Feb 5, 2020
@carakas carakas requested a review from forkcms/core-contributors Feb 5, 2020
@carakas carakas added this to the 5.8.0 milestone Mar 3, 2020
);
$this->assertPageLoadedCorrectly($client, '/private/en/tags/index', [LoadTagsTags::TAGS_TAG_2_NAME]);
$this->assertClickOnLink($client, LoadTagsTags::TAGS_TAG_2_NAME, [LoadTagsTags::TAGS_TAG_2_NAME]);
$this->assertCurrentUrlContains($client, '&id=2');

This comment has been minimized.

Copy link
@bjorvack

bjorvack Mar 3, 2020

Contributor

Shouldn't you use $this->assertCurrentUrlContains($client, '&id=' . LoadTagsTags::TAGS_TAG_2_ID);

This comment has been minimized.

Copy link
@carakas

carakas Mar 3, 2020

Author Member

Fixed in ec7b66c

$this->kernelDir = $this->getProvidedData()[0]->getContainer()->getParameter('kernel.project_dir') . '/app';
}

protected function onNotSuccessfulTest($e): void

This comment has been minimized.

Copy link
@bjorvack

bjorvack Mar 3, 2020

Contributor

Use a better variable name

This comment has been minimized.

Copy link
@carakas

carakas Mar 3, 2020

Author Member

This is a method from phpunit and part of their interface so I can't change it

This comment has been minimized.

Copy link
@carakas

carakas Mar 3, 2020

Author Member

fixed in 0cf43e9 and 93189de

$client->click($link);

$this->assertIs200($client);
$this->assertClickOnLink($client, LoadBlogPosts::BLOG_POST_TITLE, [LoadBlogPosts::BLOG_POST_TITLE]);
$this->assertCurrentUrlContains($client, '&id=1');

This comment has been minimized.

Copy link
@bjorvack

bjorvack Mar 3, 2020

Contributor

Use a constant for the id like the other tests

This comment has been minimized.

Copy link
@carakas

carakas Mar 3, 2020

Author Member

Fixed in ec7b66c

carakas added 6 commits Mar 3, 2020
@carakas carakas merged commit ad7a763 into forkcms:master Mar 3, 2020
2 of 3 checks passed
2 of 3 checks passed
Scrutinizer Analysis: Running – Tests: pending
Details
continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@carakas carakas deleted the justcarakas:325-improve-testsuite-simplify-testing branch Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.