8000 asset test coverage by eventhorizonpl · Pull Request #16428 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

asset test coverage #16428

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

Closed
wants to merge 4 commits into from
Closed

asset test coverage #16428

wants to merge 4 commits into from

Conversation

eventhorizonpl
Copy link

Hi,

This PR adds 100% tests code coverage for Asset component.

Best regards,
Michal

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

asset test coverage p2

asset test coverage p3
@SongoQ
Copy link
Contributor
SongoQ commented Nov 2, 2015

👍

->getMock();
$requestStackContext = new RequestStackContext($requestStack);

$this->assertInstanceOf('Symfony\Component\Asset\Context\RequestStackContext', $requestStackContext);
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is not really useful as all it does is it verifies if PHP works properly. All the other tests already cover this case.

I'd see some value in such a test case if it was verifying if a certain interface is implemented (it would communicate certain design decision).

Copy link
Author

Choose a reason for hiding this comment

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

10000

something like that?
$this->assertInstanceOf('Symfony\Component\Asset\Context\ContextInterface', $requestStackContext);

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes 👍

I wouldn't call the method testConstructor, but sth like testItIsAContext

@jakzal
Copy link
Contributor
jakzal commented Nov 2, 2015

Thanks for putting effort into adding more tests 👍

@TomasVotruba
Copy link
Contributor

👍

public function testItIsAContext()
{
$requestStack = $this->getMockBuilder('Symfony\Component\HttpFoundation\RequestStack')
->getMock();
Copy link
Contributor

Choose a reason for hiding this comment

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

Last occurrence of the mock builder :)

@jakzal
Copy link
Contributor
jakzal commented Nov 3, 2015

status: reviewed

👍


class RequestStackContextTest extends \PHPUnit_Framework_TestCase
{
public function testItIsAContext()
Copy link
Member

Choose a reason for hiding this comment

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

IMO, this test brings no value. We don't have such tests in Symfony (and you don't do it for NullContext btw)

@eventhorizonpl
Copy link
Author

@jakzal @stof

Thanks for review. Comments addressed.

@jakzal
Copy link
Contributor
jakzal commented Nov 3, 2015

For the merger: this should be probably merged into 2.7.

status: reviewed

@fabpot
Copy link
Member
fabpot commented Nov 4, 2015

Thank you @eventhorizonpl.

fabpot added a commit that referenced this pull request Nov 4, 2015
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #16428).

Discussion
----------

asset test coverage

Hi,

This PR adds 100% tests code coverage for Asset component.

Best regards,
Michal

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Commits
-------

5a6c1f2 asset test coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0