Exemplo n.º 1
0
 public function testArrayAccess()
 {
     $map = new Map();
     $map['a'] = 'b';
     $this->assertEquals(1, $map->size());
     $this->assertTrue($map->has('a'));
     $this->assertFalse($map->has('c'));
     $this->assertTrue($map->contains('b'));
     $this->assertFalse($map->contains('c'));
     $this->assertEquals($map['a'], $map->get('a'));
     $this->assertTrue(isset($map['a']));
     $this->assertFalse(isset($map['c']));
     $map['a'] = 'x';
     $this->assertEquals('x', $map['a']);
     unset($map['a']);
     $this->assertFalse($map->has('a'));
     $this->assertEquals(0, $map->size());
 }
 /**
  * Returns whether the given use statement is present
  *
  * @param string $qualifiedName
  * @return bool
  */
 public function hasUseStatement($qualifiedName)
 {
     return $this->useStatements->contains($qualifiedName);
 }
Exemplo n.º 3
0
 /**
  * Returns whether the given header exists
  *
  * @param Header $header
  * @return bool
  */
 public function contains(Header $header)
 {
     return $this->headers->contains($header);
 }
Exemplo n.º 4
0
 /**
  * Returns whether the given schema exists
  *
  * @param Schema $schema
  * @return bool
  */
 public function contains(Schema $schema)
 {
     return $this->definitions->contains($schema);
 }
Exemplo n.º 5
0
 /**
  * Returns whether the given scheme exists
  *
  * @param SecurityScheme $scheme
  * @return bool
  */
 public function contains(SecurityScheme $scheme)
 {
     return $this->schemes->contains($scheme);
 }
Exemplo n.º 6
0
 /**
  * Returns whether the given path exists
  *
  * @param Path $path
  * @return bool
  */
 public function contains(Path $path)
 {
     return $this->paths->contains($path);
 }
Exemplo n.º 7
0
 /**
  * Returns whether the given response exists
  *
  * @param Response $response
  * @return bool
  */
 public function contains(Response $response)
 {
     return $this->responses->contains($response);
 }