damianopetrungaro/clean-architecture

View on GitHub

Showing 7 of 7 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public function testAddDataMethod($fakeInitialArray, $value, $expectedValue)
{
// Create a mock for data and error
$dataCollection = $this->prophesize(Collection::class);
$dataCollection->get('key', [])->shouldBeCalledTimes(1)->willReturn($fakeInitialArray);
Severity: Major
Found in tests/Unit/UseCase/Response/ResponseTest.php and 1 other location - About 2 hrs to fix
tests/Unit/UseCase/Response/ResponseTest.php on lines 85..97

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public function testAddErrorMethod($fakeInitialArray, $value, $expectedValue)
{
// Create a mock for data and error
$errorCollection = $this->prophesize(Collection::class);
$errorCollection->get('key', [])->shouldBeCalledTimes(1)->willReturn($fakeInitialArray);
Severity: Major
Found in tests/Unit/UseCase/Response/ResponseTest.php and 1 other location - About 2 hrs to fix
tests/Unit/UseCase/Response/ResponseTest.php on lines 62..74

CollectionTest has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class CollectionTest extends TestCase
{
/**
* Check that the items passed in the constructor is correctly assigned
*
Severity: Minor
Found in tests/Unit/Common/Collection/CollectionTest.php - About 2 hrs to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    public function testReplaceDataMethod($value)
    {
    // Create a mock for data and error
    $dataCollection = $this->prophesize(Collection::class);
    $dataCollection->with('key', $value)->shouldBeCalledTimes(1);
    Severity: Minor
    Found in tests/Unit/UseCase/Response/ResponseTest.php and 1 other location - About 1 hr to fix
    tests/Unit/UseCase/Response/ResponseTest.php on lines 40..51

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    public function testReplaceErrorMethod($value)
    {
    // Create a mock for data and error
    $errorCollection = $this->prophesize(Collection::class);
    $errorCollection->with('key', $value)->shouldBeCalledTimes(1);
    Severity: Minor
    Found in tests/Unit/UseCase/Response/ResponseTest.php and 1 other location - About 1 hr to fix
    tests/Unit/UseCase/Response/ResponseTest.php on lines 19..30

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    public function testGetDataAndGetErrors(array $expected, array $actual)
    {
    // Create a mock for data and error
    $collectionProphecy = $this->prophesize(Collection::class);
    $collectionProphecy->all()->willReturn($expected);
    Severity: Minor
    Found in tests/Unit/UseCase/Response/ResponseTest.php and 1 other location - About 50 mins to fix
    tests/Unit/UseCase/Response/ResponseTest.php on lines 127..138

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    public function testHasDataAndHasErrorsMethodAreEquals($expected, $actual)
    {
    // Create a mock for data and error
    $collectionProphecy = $this->prophesize(Collection::class);
    $collectionProphecy->length()->willReturn($expected);
    Severity: Minor
    Found in tests/Unit/UseCase/Response/ResponseTest.php and 1 other location - About 50 mins to fix
    tests/Unit/UseCase/Response/ResponseTest.php on lines 107..117
    Severity
    Category
    Status
    Source
    Language