Example #1
0
 function testGetUsers()
 {
     //Arrange
     $beer_name = "Your mom";
     $style = "IPA";
     $abv = 4;
     $ibu = 6;
     $container = "bottle";
     $brewery = "daddy";
     $id = 1;
     $image = "../img/test.jpg";
     $test_beer = new Beer($beer_name, $style, $abv, $ibu, $container, $brewery, $image, $id);
     $test_beer->save();
     $user_name = "Wings";
     $preferred_style = "IPA";
     $region = "NW";
     $id2 = 2;
     $test_user = new User($user_name, $preferred_style, $region);
     $test_user->save();
     $user_name2 = "Wings";
     $preferred_style2 = "IPA2";
     $region2 = "NW2";
     $id3 = 3;
     $test_user2 = new User($user_name2, $preferred_style2, $region2);
     $test_user2->save();
     //Act
     $test_beer->addUser($test_user->getId());
     $test_beer->addUser($test_user2->getId());
     //Assert
     $this->assertEquals([$test_user, $test_user2], $test_beer->getUsers());
 }