Example #1
0
 /**
  * @test
  */
 public function countOfLiveNeigbohrs()
 {
     $cell = new \Cell(1, 1, true);
     $this->object->addCell($cell);
     $this->assertEquals(1, $this->object->getCountOfLiveCellsInNeigbohr(1, 2));
     $this->assertEquals(1, $this->object->getCountOfLiveCellsInNeigbohr(1, 0));
     $this->assertEquals(0, $this->object->getCountOfLiveCellsInNeigbohr(1, 1));
     $this->assertEquals(1, $this->object->getCountOfLiveCellsInNeigbohr(2, 2));
     $this->assertEquals(0, $this->object->getCountOfLiveCellsInNeigbohr(10, 10));
 }
Example #2
0
                 redirect($options['site_url'] . '/admin.php?area=' . $area);
             }
             if (isset($_POST['delete'])) {
                 Division::deleteDivision($id);
                 redirect($options['site_url'] . '/admin.php?area=' . $area);
             }
         } else {
             $template->page_title = 'Manage Divisions';
         }
     }
     break;
 case 'cells':
     if ($action == 'add') {
         $template->page_title = 'Add New Cell';
         if (isset($_POST['submit'])) {
             Cell::addCell($_POST);
             redirect($options['site_url'] . '/admin.php?area=' . $area);
         }
     } else {
         if ($action == 'view') {
             $template->page_title = 'View Cell';
             if (isset($_POST['submit'])) {
                 Cell::saveCell($id, $_POST);
                 redirect($options['site_url'] . '/admin.php?area=' . $area);
             }
             if (isset($_POST['delete'])) {
                 Cell::deleteCell($id);
                 redirect($options['site_url'] . '/admin.php?area=' . $area);
             }
         } else {
             $template->page_title = 'Manage Cells';