コード例 #1
0
ファイル: PatronTest.php プロジェクト: umamiMike/Library
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: PatronTest.php プロジェクト: kevintokheim/Library
 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);
 }
コード例 #4
0
ファイル: PatronTest.php プロジェクト: bborealis/library-1
 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);
 }
コード例 #5
0
ファイル: PatronTest.php プロジェクト: alexdbrown/library
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
0
ファイル: app.php プロジェクト: CaseyH33/Beer_Me
    $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,
コード例 #8
0
ファイル: PatronTest.php プロジェクト: r-hills/Library
 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);
 }
コード例 #9
0
ファイル: PatronTest.php プロジェクト: kennygrage/epicLibrary
 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);
 }
コード例 #10
0
ファイル: PatronTest.php プロジェクト: jschold/Library
 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);
 }
コード例 #11
0
ファイル: PatronTest.php プロジェクト: jlbethel/Library
 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);
 }
コード例 #12
0
ファイル: PatronTest.php プロジェクト: CaseyH33/Beer_Me
 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);
 }
コード例 #13
0
ファイル: PatronTest.php プロジェクト: jcubed22/library-1
 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);
 }
コード例 #14
0
ファイル: app.php プロジェクト: jlbethel/Library
});
$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) {
コード例 #15
0
 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);
 }
コード例 #16
0
ファイル: PatronTest.php プロジェクト: jlbethel/library-1
 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);
 }
コード例 #17
0
ファイル: PatronTest.php プロジェクト: bencasalino/library
 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);
 }