Não reconhece metodo shouldReceive

Estou fazendo a aula https://academy.especializati.com.br/aula/mock-classe-com-mockery-e-spies e o metodo shouldRecive não está sendo reconhecido.
Preciso de ajuda para resolver
Tentei colocar o codigo todo aqui mas da erro
Atenção!
O campo text não pode conter mais de 10000 caracteres.
There was 1 error:
1) Tests\Core\Payment\PaymentControllerUnitTest::test_payment
Error: Call to a member function makePayment() on null
/var/www/src/Core/Payment/PaymentController.php:17
/var/www/tests/Unit/Core/Payment/PaymentUnitTest.php:20
ERRORS!
Tests: 8, Assertions: 14, Errors: 1.
Script vendor/bin/phpunit handling the phpunit event returned with error code 2


Olá, João Gabriel!
Tudo bem?
Seu mock está certo.
Tem o código completo no GitHub?
Preciso ter uma visão geral para te ajudar.

Upei no github professor
https://github.com/jglopesdev/curso-php-laravel-tdd
Aguardo retorno!
Muito obrigado

Vou rodar agora o seu projeto, pra te dar um feedback.

Achei seu erro, está aqui:
https://github.com/jglopesdev/curso-php-laravel-tdd/blob/main/src/Core/Payment/PaymentController.php#L11
Deve ficar assim:
$this->payment = $payment;
Ou, apenas:
public function __construct(private PaymentInterface $payment)
{
}

Fiz essa alteração no PaymentController, mas não resolveu o problema, o metodo shouldReceive ainda está dando erro.
Pode me ajudar?

Aquele erro resolveu, agora é seu mock que está errado, precisa retornar um objeto, e está returnando um booleno.

Mas professor, meu mock está igual o seu https://ibb.co/tKMjfFb olha o print do video.
Desculpe mas ainda não consegui entender.. estou travado no curso

Me dê detalhes do erro, que te ajudo resolver.
No aguardo amigo!

Mas eu já detalhei, até upei no github o meu código e enviei print mostrando que está igual ao codigo da aula.
Infelizmente estou com a impressão que não está querendo ajudar.
o shouldReceive fica com uma cobrinha de erro vermelha embaixo.
$mockPayment->shouldReceive('makePayment')->andReturn(true);

Queria um print do erro, seria mais rápido te ajudar, mas sem problemas, eu rodo o seu projeto aqui mais tarde (IGUAL JÁ FIZ ANTES =D)

Eu postei o erro no dia 08 aqui
Segue novamente
CRIADOR João Gabriel de Santana Lopes
There was 1 error:
1) Tests\Core\Payment\PaymentControllerUnitTest::test_payment
Error: Call to a member function makePayment() on null
/var/www/src/Core/Payment/PaymentController.php:17
/var/www/tests/Unit/Core/Payment/PaymentUnitTest.php:20
ERRORS!
Tests: 8, Assertions: 14, Errors: 1.
Script vendor/bin/phpunit handling the phpunit event returned with error code 2

Mesmo depois da alteração o mesmo erro?

Rodei aqui para sumiular o erro, e NÃO é o mesmo do dia 08/08!! ;-)
O novo erro (isso faz total diferença no suporte): https://prnt.sc/-hKofTtNBdFS
"Return value must be of type object, bool returned"
--
Achei o seu erro, sua interface está errada, precisa retornar um bool e não um object:
https://github.com/especializati/php-laravel-tdd/blob/php-tdd/src/Core/Payment/PaymentInterface.php#L9
--
Se tiver dúvidas, pode contar sempre comigo. TMJ!

Precisa estar logado para conseguir responder a este ticket!
Clique Aqui Para Entrar!