コード例 #1
0
 /**
  * @test
  */
 public function is_key_when_no_path_is_given()
 {
     $structureItem = new StructureItem('onlyAKey', StructureDefinition::STRING);
     $this->assertEquals('onlyAKey', $structureItem->pathWithKey());
 }
コード例 #2
0
 /**
  * @param string|StructureItem $aPathOrStructureItem
  * @return bool
  */
 public function isSubItemOf($aPathOrStructureItem)
 {
     if ($aPathOrStructureItem instanceof StructureItem) {
         $aPath = $aPathOrStructureItem->pathWithKey();
     } else {
         Assertion::string($aPathOrStructureItem);
         $aPath = $aPathOrStructureItem;
     }
     return strpos($this->path(), $aPath) === 0;
 }