PHPUnit_Framework_Assert::anything PHP Method

anything() public static method

Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.
public static anything ( ) : PHPUnit_Framework_Constraint_IsAnything
return PHPUnit_Framework_Constraint_IsAnything
    public static function anything()
    {
        return new PHPUnit_Framework_Constraint_IsAnything();
    }

Usage Example

 /**
  * A test for argument swapping.
  */
 public function testArgumentSwappingOrder()
 {
     $message = '%3$swap %2$swap %1$swap';
     $formatter = $this->createMock(FormatterInterface::class);
     $formatter->expects($this->atLeastOnce())->method('has')->with('swap')->willReturn(true);
     $formatter->expects($this->atLeastOnce())->method('formatValue')->with('swap', \PHPUnit_Framework_Assert::anything())->willReturnOnConsecutiveCalls('value3', 'value2', 'value1');
     $intlFormat = new IntlFormat([$formatter]);
     $expected = 'value3 value2 value1';
     $this->assertSame($expected, $intlFormat->format($message, 'value1', 'value2', 'value3'));
 }
All Usage Examples Of PHPUnit_Framework_Assert::anything
PHPUnit_Framework_Assert