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

Unit tests #65

Merged
merged 6 commits into from
Jun 21, 2020
Merged

Unit tests #65

merged 6 commits into from
Jun 21, 2020

Conversation

wolfgangschaefer
Copy link
Contributor

@wolfgangschaefer wolfgangschaefer commented May 21, 2020

As mentioned in #1 I will add more unit tests to the code.

Tests added for following namespaces:

  • Roots\Acorn\Assets
  • Roots\Acorn\Clover
  • Roots\Acorn\Exceptions

I made as little changes to the code base as possible, I will document them here:

  • Added ext-json to composer.json as JsonSerializable was in use
  • Added <directory>./tests</directory> to whitelist in phpunit.xml.dist to correctly calculate coverage
  • Removed unused Roots\Acorn\Assets\RelativePathManifest and fixed type hints in AssetManager.php
  • Fixed types RelativePathManifest.php and added missing array initialization
  • Fixed type in Acorn/Bootstrap/LoadBindings.php
  • Added missing dependency to illuminate/http and fixed type hint in Acorn/Exceptions/Handler.php render method

…, Add tests for Assets namespace, Add missing ext-json requirement, Add tests folder to phpunit whitelist for correct calculation of test coverage
@Log1x
Copy link
Member

Log1x commented May 21, 2020

Really appreciate you jumping in to work on this.

@wolfgangschaefer
Copy link
Contributor Author

In SageTest there are a couple of unit tests marked incomplete:

    /** @test */
    public function it_should_compile_list_of_theme_templates()
    {
        $this->markTestIncomplete();
    }

    /** @test */
    public function it_should_share_the_loop_post_with_view()
    {
        $this->markTestIncomplete();
    }

    /** @test */
    public function it_should_load_data_based_on_body_class()
    {
        $this->markTestIncomplete();
    }

I don't understand what exactly should be tested. But I would like to complete them ;)
Originally they were contributed by @QWp6t - Maybe someone can explain what should be tested here?

Another question I had in mind was if I could have a look at Clover itself. It would give me better insight into how Clover and Acorn work together. I could not find Clover in Roots repositories.

This week the PR will be ready for review. I am only missing the View namespace.

@QWp6t
Copy link
Member

QWp6t commented Jun 2, 2020

Thanks again for your contributions. 🙌

We've added a lot more to Sage since I added those empty tests, but here are links to what I was intending to test:

@wolfgangschaefer wolfgangschaefer marked this pull request as ready for review June 16, 2020 18:12
@wolfgangschaefer
Copy link
Contributor Author

Added the tests that were marked incomplete and opened the PR for review.

@QWp6t QWp6t merged commit 30adb9d into roots:master Jun 21, 2020
@QWp6t
Copy link
Member

QWp6t commented Jun 21, 2020

Thanks for all the work you put into this! 🙏

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.

3 participants