当前位置: 首页>>代码示例>>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;未经允许,请勿转载。