Exemple #1
0
 /**
  *  Disc#getWhite test.
  *
  *  @access public
  *  @since  1.0.0
  */
 public function testWhiteStatus()
 {
     $actual = Disc::getWhite();
     $this->assertEquals($actual->getRaw(), Disc::DISC_WHITE);
     $this->assertFalse($actual->isEmpty());
     $this->assertFalse($actual->isBlack());
     $this->assertTrue($actual->isWhite());
 }
Exemple #2
0
 /**
  *  Board#getEstimation test.
  *
  *  @access public
  *  @since  1.0.0
  */
 public function testGetEstimation()
 {
     foreach (Board::$directions as $direction => $offset) {
         $this->instance->reset();
         $this->instance->setDisc(9, 9, Disc::getBlack());
         foreach (\range(1, 4) as $index) {
             $row = 9 + $offset[0] * $index;
             $col = 9 + $offset[1] * $index;
             $this->instance->setDisc($row, $col, Disc::getBlack());
             $rtv = $this->instance->getEstimation($row, $col, Disc::getBlack());
             $this->assertTrue(in_array($index, $rtv));
         }
     }
 }