/**
  * @dataProvider validNameProvider
  */
 public function testConstructorAcceptsValidNamePrameters($validName)
 {
     $respectValidator = Mockery::mock(RespectValidatable::class);
     $respectValidator->shouldReceive('setName');
     $validator = new RespectValidationAdapter($validName, $respectValidator);
     assertThat($validator, is(callableValue()));
 }
Esempio n. 2
0
 public function testShouldBeCallableThatCallsProcessMethod()
 {
     $processor = new MockProcessor();
     assertThat('The processor is a callable.', $processor, is(callableValue()));
     $result = $processor(['foo' => 'bar'], 'foo');
     // The mock processor just returns the input data array.
     assertThat('The result of processor should be the same as the input.', $result, is(anArray(['foo' => 'bar'])));
     assertThat('The processor should be able to make use of the item being formatted.', $processor->getLatestItem(), is('foo'));
 }
 public function testDecribesActualTypeInMismatchMessage()
 {
     $this->assertMismatchDescription('was a string "invalid-function"', callableValue(), 'invalid-function');
 }