/** * Test user roles, we should get a few standard roles here. We also check if the role name is not empty * * @covers Yoast_GA_Admin->get_userroles() */ public function test_get_userroles() { $roles = $this->class_instance->get_userroles(); $roles_result = is_array($roles); if ($roles_result) { foreach ($roles as $values) { $this->assertArrayHasKey('id', $values); $this->assertArrayHasKey('name', $values); if (isset($values['name'])) { $this->assertNotEmpty($values['name']); } } } else { $this->assertTrue($roles_result); } }