Beispiel #1
0
 function testKeepVariadicMethod()
 {
     if (!method_exists(\ReflectionMethod::class, 'isVariadic')) {
         $this->markIncomplete('Variadic methods requires PHP 5.6');
     }
     eval('
             class CreateMocksTest_VariadicMethod {
                 public function variadic(...$a) {
                     return $a;
                 }
             }');
     /** @var Mockster|object $methods */
     $methods = new Mockster('CreateMocksTest_VariadicMethod');
     /** @var object $mock */
     $mock = $methods->__mock();
     Mockster::stub($methods->variadic('one', 'two'))->will()->call(function ($args) {
         return json_encode($args);
     });
     $this->assert->contains($mock->variadic('one', 'two'), '"0":"one","1":"two"');
 }