Exemplo n.º 1
0
 /**
  * @expectedException \TheIconic\Fixtures\Exception\FixtureException
  */
 public function testIllegalAdd()
 {
     $fixtureCities = Fixture::create($this->testParsedDataCities);
     $this->testFixtureCollection->add($fixtureCities);
     $fixtureCities = Fixture::create($this->testParsedDataFood);
     $this->testFixtureCollection->add($fixtureCities);
 }
Exemplo n.º 2
0
    if (Token::check(Input::get('token'))) {
        $validate = new Validation();
        $validation = $validate->check($_POST, array('cheritonTeam' => array('name' => 'Team', 'required' => true), 'competition' => array('name' => 'Competition', 'required' => true), 'opponent' => array('name' => 'Opponent', 'required' => true), 'homegame' => array('name' => 'Home or Away', 'required' => true), 'location' => array('name' => 'Location', 'required' => true), 'date' => array('name' => 'Date', 'required' => true), 'kickoff' => array('name' => 'Kick Off Time', 'required' => true)));
        if ($validation->passed()) {
            $dateClean = str_replace('/', '-', Input::get('date'));
            $date = date('Y-m-d', strtotime($dateClean));
            $isHomeGame = false;
            $kickOff = Input::get('kickoff');
            if (Input::get('homegame') == "true") {
                $isHomeGame = true;
            }
            if (strlen(Input::get('kickoff'))) {
                $kickOff = Input::get('kickoff');
            }
            try {
                $fixture->create(array('TeamId' => Input::get('cheritonTeam'), 'CompetitionId' => Input::get('competition'), 'LocationId' => Input::get('location'), 'OpponentId' => Input::get('opponent'), 'HomeGame' => $isHomeGame, 'Date' => $date, 'KickOff' => $kickOff));
                Session::flash('success', 'Fixture Added Successfully');
                Redirect::to('fixtures.php');
            } catch (Exception $e) {
                die($e->getMessage());
            }
            $displayErrors = "none";
        } else {
            $errorDisplay = "";
            $displayErrors = "block";
            foreach ($validation->errors() as $error) {
                $errorDisplay = $errorDisplay . $error . "<br>";
            }
        }
    }
} else {
Exemplo n.º 3
0
 public function setUp()
 {
     $this->testFixture = Fixture::create($this->testParsedData);
 }