function testFind() { $name = "Randy Mclure"; $test_patron = new Patron($name); $test_patron->save(); $name2 = "Ballface Majure"; $test_patron2 = new Patron($name2); $test_patron2->save(); $result = Patron::find($test_patron->getId()); $this->assertEquals($result, $test_patron); }
function test_find() { $name = "Joe Bongtana"; $test_patron = new Patron($name); $test_patron->save(); $name2 = "Jesus Christ"; $test_patron2 = new Patron($name2); $test_patron2->save(); $result = Patron::find($test_patron->getId()); $this->assertEquals($test_patron, $result); }
function test_find() { //Arrange $name = "Intro to Art"; $test_patron = new Patron($name); $test_patron->save(); $name2 = "Intro to Spanish"; $test_patron2 = new Patron($name2); $test_patron2->save(); //Act $result = Patron::find($test_patron->getId()); //Assert $this->assertEquals($test_patron, $result); }
function testFind() { //Arrange $name = "Jim Bob"; $id = 1; $test_patron = new Patron($name, $id); $test_patron->save(); $name2 = "Sally Sue"; $id2 = 2; $test_patron2 = new Patron($name, $id); $test_patron2->save(); //Act $result = Patron::find($test_patron2->getId()); //Assert $this->assertEquals($test_patron2, $result); }
function test_find() { //Arrange $name = "Suzie Palloozi"; $phone = "1-800-439-0398"; $test_patron = new Patron($name, $phone); $test_patron->save(); $name2 = "Tac Zoltani"; $phone2 = "1-800-407-3930"; $test_patron2 = new Patron($name2, $phone2); $test_patron2->save(); //Act $result = Patron::find($test_patron2->getId()); //Assert $this->assertEquals($test_patron2, $result); }
function testFind() { //Arrange $id = null; $name = "Marcos"; $phone = "4444"; $test_patron = new Patron($id, $name, $phone); $test_patron->save(); $name2 = "Phil"; $phone2 = "5555"; $test_patron2 = new Patron($id, $name2, $phone2); $test_patron2->save(); //Act $result = Patron::find($test_patron->getId()); //Assert $this->assertEquals($test_patron, $result); }
$mail->addReplyTo('*****@*****.**', 'Beer Me!'); $mail->isHTML(true); $mail->Subject = 'Somebody sent you a token!'; $mail->Body = 'HEY YOU GUYS! LOOK WAT I DONE DID!!!!!!.'; $mail->AltBody = 'Received token.'; $email = $_POST['email']; $name = $_POST['name']; if (!$mail->send()) { $message = 'Message could not be sent. <p>'; } else { $message = 'Message has been sent.'; } return $app['twig']->render("email.html.twig", array('message' => $message)); }); $app->post("/add_preferred_bar/{id}", function ($id) use($app) { $user = Patron::find($id); $all_bars = Bar::getAll(); $bar = Bar::find($_POST['add_bar']); $user->addPreferredBar($bar); return $app['twig']->render("patron.html.twig", array('user' => $user, 'user_tokens' => $user->getTokens(), 'all_bars' => $all_bars, 'preferred_bars' => true, 'send_token' => false, 'token_form' => false, 'edit_user' => false)); }); // $app->delete("/delete_preferred_bar/{id}/{bar_id}", function($id, $bar_id) use($app) { // $user = Patron::find($id); // $all_bars = Bar::getAll(); // $bar = Bar::find($bar_id); // $user->deleteBar($bar); // return $app['twig']->render("patron.html.twig", array( // 'user' => $user, // 'user_tokens' =>$user->getTokens(), // 'all_bars' => $all_bars, // 'preferred_bars' => false,
function test_find() { //Arrange $name = "Dan Brown"; $phone = "3"; $email = "*****@*****.**"; $test_patron = new Patron($name, $phone, $email); $test_patron->save(); //Act $result = Patron::find($test_patron->getId()); //Assert $this->assertEquals($test_patron, $result); }
function test_find() { //Arrange $patron_name = "Paco"; $id = 1; $test_patron = new Patron($patron_name, $id); $test_patron->save(); $patron_name2 = "BurritoJr"; $id2 = 2; $test_patron2 = new Patron($patron_name2, $id2); $test_patron2->save(); //Act $test_id = $test_patron->getId(); $result = Patron::find($test_id); //Arrange $this->assertEquals($test_patron, $result); }
function testFind() { $patron_name = "Jasmine"; $id = 1; $new_patron = new Patron($patron_name, $id); $new_patron->save(); $patron_name = "Aladdin"; $new_patron2 = new Patron($patron_name); $new_patron2->save(); $result = Patron::find($new_patron->getId()); $this->assertEquals($new_patron, $result); }
function test_updatePatronName() { //Arrange $patron_name = "Hannibal"; $test_patron = new Patron($patron_name); $test_patron->save(); $patron_name2 = "Johnny"; $test_patron->updatePatronName($patron_name2); //Act $id = $test_patron->getId(); $result = new Patron($patron_name2, $id); //Assert $this->assertEquals(Patron::find($id), $result); }
function testFind() { //Arrange $name = "Kyle Pratuch"; $email = "*****@*****.**"; $test_patron = new Patron($name, $email); $test_patron->save(); $name2 = "Jason Bethel"; $email2 = "*****@*****.**"; $test_patron2 = new Patron($name2, $email2); $test_patron2->save(); //Act $result = Patron::find($test_patron->getId()); //Assert $this->assertEquals($test_patron, $result); }
function testPatronFind() { //Arrange $patron_name = "Mr. Pickles"; $id = null; $test_patron = new Patron($patron_name, $id); $test_patron->save(); $patron_name2 = "John Doe"; $test_patron2 = new Patron($patron_name2, $id); $test_patron2->save(); //Act $id = $test_patron2->getId(); //Assert $result = Patron::find($id); $this->assertEquals($test_patron2, $result); }
}); $app->get("/patrons", function () use($app) { return $app['twig']->render('patrons.html.twig', array('patrons' => Patron::getAll())); }); $app->get("/book/{id}", function ($id) use($app) { $book = Book::find($id); $book_id = $book->getId(); return $app['twig']->render('book.html.twig', array('copies' => $book->getCopies(), 'book' => $book, 'authors' => $book->getAuthors(), 'all_authors' => Author::getAll())); }); $app->get("/author/{id}", function ($id) use($app) { $author = Author::find($id); $author_id = $author->getId(); return $app['twig']->render('author.html.twig', array('author' => $author, 'books' => $author->getBooks(), 'all_books' => Book::getAll())); }); $app->get("/patron/{id}", function ($id) use($app) { $patron = Patron::find($id); $patron_id = $patron->getId(); return $app['twig']->render('patron.html.twig', array('patron' => $patron, 'checkouts' => $patron->getCheckouts())); }); //-------------------------------------------------------// $app->post("/books", function () use($app) { $new_book = new Book($_POST['title']); $new_book->save(); return $app['twig']->render('books.html.twig', array('books' => Book::getAll())); }); $app->post("/authors", function () use($app) { $new_author = new Author($_POST['name']); $new_author->save(); return $app['twig']->render('authors.html.twig', array('authors' => Author::getAll())); }); $app->post("/patrons", function () use($app) {
function test_find() { $name = "Steve Brule"; $id = 1; $test_patron1 = new Patron($name, $id); $test_patron1->save(); $name2 = "Tim Heidecker"; $id2 = 2; $test_patron2 = new Patron($name2, $id2); $test_patron2->save(); $result = Patron::find($test_patron2->getId()); $this->assertEquals($test_patron2, $result); }
function test_find() { //Arrange $patron_name = "James Patterson"; $id = 1; $test_patron = new Patron($patron_name, $id); $test_patron->save(); $patron_name2 = "Albebra"; $id = 2; $test_patron2 = new Patron($patron_name2, $id); $test_patron2->save(); //Act $result = Patron::find($test_patron->getId()); //Assert $this->assertEquals($test_patron, $result); }
function find() { //Arrange $name = "Name"; $id = 1; $test_patron = new Patron($name, $id); $name2 = "Different Name"; $id2 = 2; $test_patron2 = new Patron($name2, $id2); //Act $result = Patron::find($test_patron2->getId()); //Assert $this->assertEquals($test_student2, $result); }