本文整理汇总了PHP中Label::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Label::getName方法的具体用法?PHP Label::getName怎么用?PHP Label::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRemoveLabels_DelegatesToClient
public function testRemoveLabels_DelegatesToClient()
{
$expected = $this->node;
$expected->setId(123);
$matched = false;
$label = new Label($this->client, 'FOOBAR');
$this->client->expects($this->once())->method('removeLabels')->will($this->returnCallback(function (Node $actual, $labels) use($expected, $label, &$matched) {
$matched = $expected->getId() == $actual->getId();
$matched = $matched && $label->getName() == $labels[0]->getName();
return array($label);
}));
$labels = $this->node->removeLabels(array($label));
$this->assertEquals(1, count($labels));
$this->assertSame($label, $labels[0]);
}
示例2: testContruct_ValidNameGiven_SetsNameCastAsString
/**
* @dataProvider dataProvider_ValidNames
*/
public function testContruct_ValidNameGiven_SetsNameCastAsString($name)
{
$label = new Label($this->client, $name);
self::assertEquals($name, $label->getName());
self::assertInternalType('string', $label->getName());
}
示例3: ContactMethod
$methods = $result['items'];
foreach ($methods as $m) {
$o = new ContactMethod();
$o->setName($m);
$o->save();
echo "ContactMethod: {$o->getName()}\n";
}
$result = $mongo->lookups->findOne(array('name' => 'types'));
$types = $result['items'];
foreach ($types as $t) {
$o = new IssueType();
$o->setName($t);
$o->save();
echo "IssueType: {$o->getName()}\n";
}
$result = $mongo->lookups->findOne(array('name' => 'labels'));
$labels = $result['items'];
foreach ($labels as $l) {
$o = new Label();
$o->setName($l);
$o->save();
echo "Label: {$o->getName()}\n";
}
$result = $mongo->categoryGroups->find();
foreach ($result as $r) {
$o = new CategoryGroup();
$o->setName($r['name']);
$o->setOrdering($r['order']);
$o->save();
echo "CategoryGroup: {$o->getName()}\n";
}