Skip to content

Test suite enhancement #338

@devmsh

Description

@devmsh

I know this is not a bug, but I have no other option/channel to discuss this.

1) Tests\Feature\Generators\ControllerGeneratorTest::output_writes_migration_for_controller_tree with data set #8 ('drafts/api-routes-example.yaml', 'app/Http/Controllers/Api/Cert...er.php', 'controllers/api-routes-example.php')
Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_8::put('app/Http/Controllers/Api/CertificateController.php', '<?php

namespace App\Http\Controllers\Api;

use App\Certificate;
// the rest of the content
}
'). Either the method was unexpected or its arguments matched no expected argument list for this method

The current failed test case demonstrates 2 needed enhancements in the test suite in general.

  1. Nested of using numeric datasets data set #8 we can use named associative array.
  2. Mockery provides only the actual arguments with no diff with the expected one and this makes the debugging process so hard in comparison with a unit test style that uses string/array assertions and allows for easier diff and debugging.

If you agreed about that, I will start to mirror the current tests using more low-level tests that can use assertions nested of mockery expectations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingThis issue is pending review

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions