Index: tests/phpunit/tests/user/capabilities.php
===================================================================
--- tests/phpunit/tests/user/capabilities.php	(revision 37153)
+++ tests/phpunit/tests/user/capabilities.php	(working copy)
@@ -398,6 +398,29 @@
 		}
 	}
 
+	/**
+	 * @ticket 36376
+	 */
+	function test_multiple_roles() {
+		// Create a new customer role
+		$role_name = 'customer';
+		$expected_caps = array(
+			'read' => true,
+		);
+		add_role( $role_name, 'Customer', $expected_caps );
+		$this->_flush_roles();
+
+		// create a new user and add the editor and customer roles to it
+		$user = self::factory()->user->create_and_get( array( 'role' => 'author' ) );
+		$user->add_role( 'customer' );
+
+		wp_set_current_user( $user->ID );
+
+		$this->assertEquals( array( 'author', 'customer' ), $user->roles );
+		$this->assertTrue( $user->has_cap( 'edit_posts' ) );
+		$this->assertTrue( current_user_can( 'edit_posts' ) );
+	}
+
 	// a user with multiple roles
 	function test_user_subscriber_contributor() {
 		$user = self::$users['subscriber'];
