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

Return value must be of type Spatie\RouteTesting\RouteTesting, Pest\PendingCalls\TestCall returned #7

Open
pratikkuikel opened this issue Jul 20, 2024 · 1 comment

Comments

@pratikkuikel
Copy link

Steps to reproduce

  1. Make sure pest is installed.
  2. Composer require spatie/pest-plugin-route-testing
  3. Create a new file : RouteTest.php in tests/Feature directory.
  4. Write the code
<?php

use function Spatie\RouteTesting\routeTesting;

routeTesting('all routes')
    ->assertSuccessful();
  1. Run php artisan test
  2. See the error
   ERROR  Spatie\RouteTesting\routeTesting(): Return value must be of type Spatie\RouteTesting\RouteTesting, Pest\PendingCalls\TestCall returned

   Location: \vendor\spatie\pest-plugin-route-testing\src\Autoload.php:16

   #0 \tests\Feature\RouteTest.php(5): Spatie\RouteTesting\routeTesting('all routes')
   #1 \vendor\pestphp\pest\overrides\Runner\TestSuiteLoader.php(89): include_once('C:\\Users\\prati\\...')
   #2 \vendor\pestphp\pest\overrides\Runner\TestSuiteLoader.php(92): PHPUnit\Runner\TestSuiteLoader::PHPUnit\Runner\{closure}()
   #3 \vendor\phpunit\phpunit\src\Framework\TestSuite.php(253): PHPUnit\Runner\TestSuiteLoader->load('C:\\Users\\prati\\...')
   #4 \vendor\phpunit\phpunit\src\Framework\TestSuite.php(270): PHPUnit\Framework\TestSuite->addTestFile('C:\\Users\\prati\\...')
   #5 \vendor\phpunit\phpunit\src\TextUI\Configuration\Xml\TestSuiteMapper.php(100): PHPUnit\Framework\TestSuite->addTestFiles(Array)
   #6 \vendor\phpunit\phpunit\src\TextUI\Configuration\TestSuiteBuilder.php(72): PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper->map('C:\\Users\\prati\\...', Object(PHPUnit\TextUI\Configuration\TestSuiteCollection), '', '')
   #7 \vendor\phpunit\phpunit\src\TextUI\Application.php(349): PHPUnit\TextUI\Configuration\TestSuiteBuilder->build(Object(PHPUnit\TextUI\Configuration\Configuration))
   #8 \vendor\phpunit\phpunit\src\TextUI\Application.php(108): PHPUnit\TextUI\Application->buildTestSuite(Object(PHPUnit\TextUI\Configuration\Configuration))
   #9 \vendor\pestphp\pest\src\Kernel.php(103): PHPUnit\TextUI\Application->run(Array)
   #10 \vendor\pestphp\pest\bin\pest(91): Pest\Kernel->handle(Array, Array)
   #11 \vendor\pestphp\pest\bin\pest(99): {closure}()
   #12 {main}.

Please correct me if my implementation is wrong.

@netdelight
Copy link

Exact same problem here, and I'm new to Pest, so I'm not sure if the implementation is right.

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

No branches or pull requests

2 participants