Skip to content

Remove dead code from ReferenceListTest#637

Merged
Benestar merged 1 commit intomasterfrom
assertTrueTrue
Feb 18, 2016
Merged

Remove dead code from ReferenceListTest#637
Benestar merged 1 commit intomasterfrom
assertTrueTrue

Conversation

@thiemowmde
Copy link
Copy Markdown
Contributor

Can you imagine what the $this->assertTrue( true ) and the lines above was meant to do? I tracked it down to commit c721869f41fa0637a7171a61526b34acfaee4101 (on Gerrit). To me it appears to be a mistake.

@Benestar
Copy link
Copy Markdown
Contributor

Maybe testing that it doesn't throw an exception? Strange indeed...

As you suggested once, it would be best to rewrite the whole test while re-working the methods on ReferenceList to be more intuitive and less magic.

Benestar added a commit that referenced this pull request Feb 18, 2016
Remove dead code from ReferenceListTest
@Benestar Benestar merged commit d30e2bf into master Feb 18, 2016
@Benestar Benestar deleted the assertTrueTrue branch February 18, 2016 17:18
thiemowmde pushed a commit that referenced this pull request Feb 18, 2016
Remove dead code from ReferenceListTest
@Benestar Benestar restored the assertTrueTrue branch February 18, 2016 17:38
@Benestar Benestar deleted the assertTrueTrue branch February 18, 2016 17:41
@thiemowmde
Copy link
Copy Markdown
Contributor Author

Rewrite step by step, along with the code we touch.

$array->removeReference( $element );
$array->removeReference( $element );

$this->assertTrue( true );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now the test will not make any assertions for empty lists. This test design is not nice, though now you will get warnings in strict mode if I'm not mistaken

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried again to be sure. No bad things happen in strict mode. CI does not complain, too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe PHPUnit changed this... I remember running into this several times near the start of the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants