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

Refactored tests #769

Merged
merged 7 commits into from
Dec 4, 2017
Merged

Refactored tests #769

merged 7 commits into from
Dec 4, 2017

Conversation

carusogabriel
Copy link
Contributor

@carusogabriel carusogabriel commented Nov 30, 2017

I've refactored several tests with assertFileExists and assertFileNotExists, assertFalse, assertTrue, assertCount, assertGreaterThan, assertNull and assertNotNull methods.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 30, 2017
@@ -74,8 +74,8 @@ public function testIsReadable()

public function testFileExists()
{
$this->assertTrue(file_exists(self::$dirUrl));
$this->assertTrue(file_exists(self::$fileUrl));
$this->assertFilExists(self::$dirUrl);

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@jdpedrie jdpedrie left a comment

Choose a reason for hiding this comment

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

thanks for the contribution! definitely improves reporting failures. 👍

@jdpedrie jdpedrie added testing type: cleanup An internal cleanup or hygiene concern. labels Dec 1, 2017
@carusogabriel
Copy link
Contributor Author

I've refactored more tests, this time using assertLessThanOrEqual or assertGreaterThanOrEqual.

@carusogabriel
Copy link
Contributor Author

Use assertContains and assertNotContains when comparing string.

@carusogabriel
Copy link
Contributor Author

Use assertStringEqualsFile when comparing file and string.

@carusogabriel
Copy link
Contributor Author

Check types with assertInternalType, instead of PHP build in functions is_*.

@carusogabriel
Copy link
Contributor Author

carusogabriel commented Dec 1, 2017

Use assertContains and assertNotContains instead in_array when checking for values in array.

@jdpedrie
Copy link
Contributor

jdpedrie commented Dec 2, 2017

@carusogabriel let me know when you're finished.

@carusogabriel
Copy link
Contributor Author

@jdpedrie I'm finished, sorry about many commits, I need to do some research. Do you want me to squash them?

@jdpedrie
Copy link
Contributor

jdpedrie commented Dec 2, 2017

No problem at all. I just wanted to be sure I didn’t interrupt your work. Thanks for the contribution.

You don’t need to squash it.

@carusogabriel
Copy link
Contributor Author

I swear is the last one 😇

Use assertInstanceOf instead of strict comparisons with instanceof PHP operator;

@jdpedrie jdpedrie merged commit 385e3ef into googleapis:master Dec 4, 2017
@carusogabriel carusogabriel deleted the refactoring-tests branch December 4, 2017 15:21
gcf-owl-bot bot added a commit that referenced this pull request Jan 20, 2023
Source-Link: googleapis/googleapis@9fac84a

Source-Link: googleapis/googleapis-gen@12ae1da
Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiMTJhZTFkYTdjMTM0NzJhMTFlMWE0YTYxODlhYWIxMGY3ODNjNTg1MyJ9
bshaffer pushed a commit that referenced this pull request Feb 8, 2023
…#5802)

* feat: Update Compute Engine API to revision 20221224 (#760)

Source-Link: googleapis/googleapis@17d5613

Source-Link: googleapis/googleapis-gen@42cd552
Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiNDJjZDU1MmZhNWJlOTViZTVjZTUxMzZiYTkzZTgzMzg4Yjc1OTFkOCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: Update Compute Engine API to revision 20230103 (#769)

Source-Link: googleapis/googleapis@9fac84a

Source-Link: googleapis/googleapis-gen@12ae1da
Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiMTJhZTFkYTdjMTM0NzJhMTFlMWE0YTYxODlhYWIxMGY3ODNjNTg1MyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
bshaffer pushed a commit that referenced this pull request Mar 21, 2023
…#5802)

* feat: Update Compute Engine API to revision 20221224 (#760)

Source-Link: googleapis/googleapis@17d5613

Source-Link: googleapis/googleapis-gen@42cd552
Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiNDJjZDU1MmZhNWJlOTViZTVjZTUxMzZiYTkzZTgzMzg4Yjc1OTFkOCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: Update Compute Engine API to revision 20230103 (#769)

Source-Link: googleapis/googleapis@9fac84a

Source-Link: googleapis/googleapis-gen@12ae1da
Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiMTJhZTFkYTdjMTM0NzJhMTFlMWE0YTYxODlhYWIxMGY3ODNjNTg1MyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. testing type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants