mercredi 24 juin 2020

Codeception unit testing php. Check that a function has been called with a certain parameter

I try to find the solution for the simple issue. I need to check, that a function has been called with a certain parameter. But I can just check, that a function has been called and return some parameter. I was searching in codeseption docs very long. Have codeception some method for this?

   public function testSomething()
   {
      $conversation = $this->make('Class', [
         'ask' => \Codeception\Stub\Expected::once('this string will be returned')
      ]);
      $conversation->run();
   }

Aucun commentaire:

Enregistrer un commentaire