當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Test::getName方法代碼示例

本文整理匯總了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();
開發者ID:Khwesten,項目名稱:GettersAndSetters,代碼行數:22,代碼來源:index.php

示例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;
 }
開發者ID:wikidi,項目名稱:envtesting,代碼行數:11,代碼來源:Filter.php

示例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;
 }
開發者ID:rybakit,項目名稱:msgpack.php,代碼行數:6,代碼來源:TestSkippedException.php

示例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>";
?>

開發者ID:stringsanbu,項目名稱:COMS319,代碼行數:29,代碼來源:02_introToPhp.php

示例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();


 ?>
開發者ID:akashsinha123,項目名稱:php-practice,代碼行數:31,代碼來源:overloading.php

示例6: addChildTest

 /**
  * Add child test
  * @param Test $test
  * @return TreeTest
  */
 public function addChildTest(Test $test) : TreeTest
 {
     $this->childTests[$test->getName()] = $test;
     return $this;
 }
開發者ID:AtanorPHP,項目名稱:testbox,代碼行數:10,代碼來源:TreeTestTrait.php


注:本文中的Test::getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。