Beispiel #1
0
 public function testCreateUser()
 {
     Scripts::CreateUser('*****@*****.**', 'Bill Gates', 'Gates123');
     $newuser = RedBean::load('users', 4);
     $this->assertEquals($newuser->id, '4');
     $this->assertEquals($newuser->name, 'Bill Gates');
     $this->assertEquals($newuser->email, '*****@*****.**');
 }
Beispiel #2
0
 public function testBanUser()
 {
     Scripts::CreateUser('*****@*****.**', 'Alan turing', 'turing123');
     Scripts::LoginAdmin();
     $this->byLinkText('Users Management')->click();
     $this->byLinkText('Ban User')->click();
     $this->byName('id')->click();
     $this->fillFields(array('id' => '3', 'days' => '10'));
     $this->byName('banuser')->click();
     $userbanned = RedBean::load('users', 3);
     date_default_timezone_set('America/Los_Angeles');
     $this->assertEquals($userbanned->banned, date('Ymd', strtotime('+10 days')));
 }