本文整理汇总了PHP中PHPUnit_Framework_Assert::stringEndsWith方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::stringEndsWith方法的具体用法?PHP PHPUnit_Framework_Assert::stringEndsWith怎么用?PHP PHPUnit_Framework_Assert::stringEndsWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::stringEndsWith方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: theConsoleOutputShouldHaveLinesEndingIn
/**
* @Then /^the console output should have lines ending in:$/
*/
public function theConsoleOutputShouldHaveLinesEndingIn(PyStringNode $string)
{
$stdOutLines = explode(PHP_EOL, $this->lastBehatStdOut);
$expectedLines = $string->getLines();
\PHPUnit_Framework_Assert::assertCount(count($expectedLines), $stdOutLines);
foreach ($stdOutLines as $idx => $stdOutLine) {
$suffix = isset($expectedLines[$idx]) ? $expectedLines[$idx] : '(NONE)';
$constraint = \PHPUnit_Framework_Assert::stringEndsWith($suffix);
$constraint->evaluate($stdOutLine);
}
}
示例2: stringEndsWith
/**
* Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
*
* @param mixed $suffix
* @return PHPUnit_Framework_Constraint_StringEndsWith
* @since Method available since Release 3.4.0
*/
function stringEndsWith($suffix)
{
return PHPUnit_Framework_Assert::stringEndsWith($suffix);
}
示例3: testConstraintStringEndsNotWith2
/**
* @covers PHPUnit_Framework_Constraint_StringEndsWith
* @covers PHPUnit_Framework_Assert::stringEndsWith
*/
public function testConstraintStringEndsNotWith2()
{
$constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::stringEndsWith('suffix'));
try {
$constraint->fail('foosuffix', 'custom message', TRUE);
} catch (PHPUnit_Framework_ExpectationFailedException $e) {
$this->assertEquals("custom message\nFailed asserting that <string:foosuffix> ends not with \"suffix\".", $e->getDescription());
return;
}
$this->fail();
}
示例4: testConstraintStringEndsNotWith2
/**
* @covers PHPUnit_Framework_Constraint_StringEndsWith
* @covers PHPUnit_Framework_Assert::stringEndsWith
* @covers PHPUnit_Framework_TestFailure::exceptionToString
*/
public function testConstraintStringEndsNotWith2()
{
$constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::stringEndsWith('suffix'));
try {
$constraint->evaluate('foosuffix', 'custom message');
} catch (PHPUnit_Framework_ExpectationFailedException $e) {
$this->assertEquals(<<<EOF
custom message
Failed asserting that 'foosuffix' ends not with "suffix".
EOF
, PHPUnit_Framework_TestFailure::exceptionToString($e));
return;
}
$this->fail();
}
示例5: toEndWith
/**
* Expect that a string ends with a given suffix.
*
* @param string $suffix
* @param string $message
*
* @return Expect
*/
public function toEndWith($suffix, $message = '')
{
Assert::stringEndsWith($suffix, $this->value, $message);
return $this;
}
示例6: it_can_be_rendered_automatically_in_views
function it_can_be_rendered_automatically_in_views()
{
$toolbar = $this->addTool('test');
\PHPUnit_Framework_Assert::stringStartsWith('<nav class="navbar navbar-default toolbar', $toolbar);
\PHPUnit_Framework_Assert::stringEndsWith('</nav>', $toolbar);
}