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

Report check tests, drop very old TU directory #4766

Merged
merged 2 commits into from Oct 29, 2018

Conversation

trasher
Copy link
Contributor

@trasher trasher commented Oct 11, 2018

Goal is just to drop tools/phpunit directory (very first unit tests).

I've tried to keep and migrate phpunit/Framework/CommonDBTM/CanCheck.php; some results are not the same.

See commented lines in tests/functionnal/CommonDBTM.php at lines 543-558, 665, 671-673 and 680
I cannot say if original tests were wrong, or if code/logic has changed, or...

tests/functionnal/CommonDBTM.php Outdated Show resolved Hide resolved
@trasher
Copy link
Contributor Author

trasher commented Oct 29, 2018

This one targets next major because change on CommonDBRelation may have unpredictable impacts, and this needs to be tested :/


$input = [
'contacts_id' => $idc[3], // Child 2
'suppliers_id' => $ids[3] // Child 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment is wrong : should be $ids[3] // Child 2 instead of $ids[3] // Child 3.

$input=['entities_id' => -1];
$this->boolean($entity->can(-1, CREATE, $input))->isFalse("Fail: can create entity in not existing entity");

$this->boolean(\Session::changeActiveEntities('all'))->isTrue();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is a lot of duplication in tests. From this line to line 750, only tests on 99999 are not duplicated (see lines 707 to 721).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines from 752 to 761 are duplications too.

Fix entities tests

Drop duplicated lines

Wrong comment
@trasher trasher merged commit 1169a64 into glpi-project:master Oct 29, 2018
@trasher trasher deleted the drop-old-tests branch October 29, 2018 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants