Anent the second issue, we also agree with petitioner that the Complaint states a cause of action against respondent UST. In Abacan v. Northwestern University, Inc.,[13]we said:
It is settled that the existence of a cause of action is determined by the allegations in the complaint. In resolving a motion to dismiss based on the failure to state a cause of action, only the facts alleged in the complaint must be considered. The test is whether the court can render a valid judgment on the complaint based on the facts alleged and the prayer asked for. Indeed, the elementary test for failure to state a cause of action is whether the complaint alleges facts which if true would justify the relief demanded. Only ultimate facts and not legal conclusions or evidentiary facts, which should not be alleged in the complaint in the first place, are considered for purposes of applying the test. (Emphasis supplied)
While it is admitted that respondent UST was not a party to the contract, petitioner posits that the former is nevertheless liable for the construction costs. In support of its position, petitioner alleged that (1) UST and USTHI are one and the same corporation; (2) UST stands to benefit from the assets of USTHI by virtue of the latter’s Articles of Incorporation; (3) respondent controls the business of USTHI; and (4) UST’s officials have performed acts that may be construed as an acknowledgement of respondent’s liability to petitioner.
Obviously, these issues would have been best resolved during trial. The RTC therefore committed grave abuse of discretion when it dismissed the case against respondent for lack of cause of action. The trial court relied on the contract executed between petitioner and USTHI, when the court should have instead considered merely the allegations stated in the Complaint.
WHEREFORE, in view of the foregoing, the Petition is GRANTED. Branch 76 of the Regional Trial Court of Quezon City is hereby ordered to REINSTATE respondent University of Santo Tomas as a defendant in C.C. No. 0862635.
SO ORDERED."