Exemplo n.º 1
0
 public function testContains()
 {
     $bounds = new Bounds(new LatLng(-122, 37), new LatLng(-123, 38));
     $this->assertTrue($bounds->contains(new LatLng(-122, 37)));
     $this->assertTrue($bounds->contains(new LatLng(-123, 38)));
     $this->assertFalse($bounds->contains(new LatLng(-70, -12)));
 }
Exemplo n.º 2
0
 public function testPositiveNegative()
 {
     $min_x = -10;
     $min_y = -10;
     $max_x = -5;
     $max_y = -5;
     $b = new Bounds($max_x, $max_y, $min_x, $min_y);
     $this->assertEquals($min_x, $b->left);
     $this->assertEquals($min_y, $b->top);
     $this->assertEquals($max_x, $b->right);
     $this->assertEquals($max_y, $b->bottom);
     $this->assertEquals(5, $b->getWidth());
     $this->assertEquals(5, $b->getHeight());
     $this->assertTrue($b->contains(-9, -9));
     $this->assertTrue($b->contains(-5, -10));
     $this->assertFalse($b->contains(-1, 1));
 }