本文整理汇总了PHP中Test::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Test::getName方法的具体用法?PHP Test::getName怎么用?PHP Test::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Test
的用法示例。
在下文中一共展示了Test::getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Test
<?php
include './GettersAndSetters.php';
class Test extends GettersAndSetters
{
/**
* @method String getName() return the value of attribute name
* @method $this setName($value) set the value in attribute name
*/
protected $name;
/**
* @method String getNameWithUnderscore() return the value of attribute name
* @method $this setNameWithUnderscore($value) set the value in attribute name
*/
protected $_nameWithUnderscore;
}
$test = new Test();
$test->setName("Name");
$test->setNameWithUnderscore("Name");
echo $test->getName();
echo "<br>";
echo $test->getNameWithUnderscore();
示例2: isValid
/**
* Check if input test is active
*
* @param Test $test
* @param Suite $suite
* @return boolean
*/
public function isValid(Test $test, Suite $suite)
{
return $this->isActive() ? $this->name && $test->getName() === $this->name || $this->type && $test->getType() === $this->type || $this->group && $suite->getCurrentGroupName() === $this->group : true;
}
示例3: __construct
public function __construct(Test $test, $code = null, \Exception $previous = null)
{
$message = sprintf('"%s" test is skipped.', $test->getName());
parent::__construct($message, $code, $previous);
$this->test = $test;
}
示例4: getName
echo "<BR>";
$y = testScope();
echo "x is " . $x;
echo "<BR>";
echo "y is " . $y;
echo "<BR>";
echo "<hr><br>";
// OBJECTS
class Test
{
const A_BIG_NUMBER = 11111;
private $name;
static $i = 0;
function __construct($name)
{
$this->name = $name;
self::$i += 1;
}
public function getName()
{
return $this->name . " " . self::A_BIG_NUMBER;
}
}
$myObj = new Test("Timothy");
echo $myObj->getName();
echo "<br>";
// We will do objects again later.
echo "<hr><br>";
?>
示例5: getHeight
public function getHeight()
{
echo $this->height;
}
public function getName()
{
echo $this->name;
}
}
$test = new Test();
try {
$test->full_name = "Akash Sinha";
} catch (Exception $e) {
echo $e->getMessage();
}
try {
echo $test->__get("height") . "<br />";
} catch (Exception $e) {
echo $e->getMessage();
}
$test->getName() . "<br />";
$test->getHeight();
?>
示例6: addChildTest
/**
* Add child test
* @param Test $test
* @return TreeTest
*/
public function addChildTest(Test $test) : TreeTest
{
$this->childTests[$test->getName()] = $test;
return $this;
}