Пример #1
0
 /**
  *  Disc#getBlack test.
  *
  *  @access public
  *  @since  1.0.0
  */
 public function testBlackStatus()
 {
     $actual = Disc::getBlack();
     $this->assertEquals($actual->getRaw(), Disc::DISC_BLACK);
     $this->assertFalse($actual->isEmpty());
     $this->assertTrue($actual->isBlack());
     $this->assertFalse($actual->isWhite());
 }
Пример #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));
         }
     }
 }