Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

test: Product Relation Mapper #11

Merged
merged 4 commits into from
May 13, 2021

Conversation

wfajczyk
Copy link
Contributor

No description provided.

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class AbstractProductRelationAttributeCase extends TestCase
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class AbstractProductRelationAttributeCase extends TestCase
abstract class AbstractProductRelationMapperAttributeCase extends TestCase

Copy link
Member

Choose a reason for hiding this comment

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

Actually, this should fail(via warning) as you have no tests in your class

Copy link
Member

Choose a reason for hiding this comment

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

Ahhh it does not have Test suffix so that's the reason probably :)


protected function getProductCrossSellingClass(): AbstractProductCrossSelling
{
return new class(
Copy link
Member

Choose a reason for hiding this comment

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

Weirdo formatting


public function testNoAttribute(): void
{
$this->product->expects(self::once())->method('hasAttribute')->willReturn(false);
Copy link
Member

Choose a reason for hiding this comment

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

It's a fake test. It should test method output, not the fact a method is called once

@wfajczyk wfajczyk merged commit ee50fa0 into ergonode:relation-attribute May 13, 2021
@wfajczyk wfajczyk deleted the test-relation-mapper branch May 13, 2021 11:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants