public function testGetUsersWithNotificationsWhenEverybodyAllowed() { $u = new User($this->container); $p = new Project($this->container); $n = new Notification($this->container); $pp = new ProjectPermission($this->container); $this->assertEquals(1, $p->create(array('name' => 'UnitTest1', 'is_everybody_allowed' => 1))); $this->assertTrue($pp->isEverybodyAllowed(1)); // Email + Notifications enabled $this->assertNotFalse($u->create(array('username' => 'user1', 'email' => 'user1@here', 'notifications_enabled' => 1))); // No email + Notifications enabled $this->assertNotFalse($u->create(array('username' => 'user2', 'email' => '', 'notifications_enabled' => 1))); // Email + Notifications enabled $this->assertNotFalse($u->create(array('username' => 'user3', 'email' => 'user3@here', 'notifications_enabled' => 1))); // No email + notifications disabled $this->assertNotFalse($u->create(array('username' => 'user4'))); $users = $n->getUsersWithNotificationEnabled(1); $this->assertNotEmpty($users); $this->assertEquals(2, count($users)); $this->assertEquals('user1@here', $users[0]['email']); $this->assertEquals('user3@here', $users[1]['email']); }