Advertisement
Guest User

Untitled

a guest
May 26th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. protected $tester;
  2.  
  3. protected function _before()
  4. {
  5. }
  6.  
  7. protected function _after()
  8. {
  9. }
  10.  
  11. // tests
  12. public function testisEmailAvailalable()
  13. {
  14.  
  15. $email = 'alk@gmail.com';
  16. $dsn = 'mysql:host=localhost;dbname=rewards';
  17. $username = 'root';
  18. $password = 'password';
  19. $connection = new yiidbConnection([
  20. 'dsn' => $dsn,
  21. 'username' => $username,
  22. 'password' => $password,
  23. ]);
  24. /*$connection->open();*/
  25.  
  26. $command = $connection->createCommand('SELECT email FROM acc_user');
  27. $emailIds = $command->query();
  28. $emailIdArray = array($emailIds);
  29. $this->assertContains('alk@gmail.com',$emailIdArray);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement