In this proceeding W. Y. Wright, C. E. Malary, J. T. Hodges, and Juan Wilson, being members of and doing business under the firm name and style of “Star Stage Line,” a copartnership, plaintiffs below’and appellees here, seek to enjoin the county attorney and sheriff of Yuma county, appellants herein, from interfering with appellees’ business of operating for hire automobile stages over certain roads in Yuma county, by enforcing against them the criminal provisions of chapter 130, Session Laws of 1919.
The appellees, pursuing the requirements of said chapter 130, which was approved March 21, 1919, and became effective June 12, 1919, had sought from the Corporation Commission a certificate of convenience and necessity permitting them to engage in the business of operating for hire automobile stages on the county roads of Yuma county between the city of Yuma and the towns of Somerton and Gadsen. The commission refused appellees the certificate prayed for on December 22, 1919, after a hearing, but granted one to the District Auto Service, a rival stage line *137operating between the same points and over the same roads.
On December 31, 1919, the day fixed by the order of the Corporation Commission as the date on which appellees were to cease business the superior court of Yuma county, acting on a verified complaint that day filed, issued a temporary restraining order commanding appellants, until further order of the court, to refrain from in any way interfering with the appellees in the operation of their business and directing them to appear on January 8, 1920, and show cause why such temporary restraining order should not be made permanent. The hearing having been continued until January 20th, the appellants, on January 19th, filed their answer, consisting of demurrers and a motion to dismiss, the first demurrer being general in its terms, and the second raising objections to the jurisdiction of the court to grant the relief prayed for because of the provisions of paragraph 2341, paragraph 2343, subdivision “h,” and paragraph 2344, Revised Statutes of Arizona of 1913. An amended complaint more fully covering the facts upon which appellees relied, but in the opinion of appellants not curing the alleged defects raised by the demurrers, was filed January 20, 1920, just as the arguments on the law questions involved were to be heard. After argument by counsel for both sides the matter was taken under advisement, and on March 5; 1920, the demurrer was overruled, and judgment thereupon entered permanently enjoining appellants from in any way interfering with the business of appellees.
Immediately after the entry of the order sustaining the demurrer, the attorney for appellants requested that they be permitted to file an amended answer pleading to the merits, but the court was of the opinion, as his recollection served him, that the case had been submitted for final determination on the *138amended complaint and.demurrers thereto, which was in accord with the understanding of the attorney for appellees as well as that of the clerk of the court, as disclosed by the minute entries of the proceedings of January 20, 1920. The attorney for appellants, however, notwithstanding his conviction of the correctness, as a matter of law, of the position he took in urging the demurrers, stated to the court at the time, as forcibly and emphatically as he could, that at no stage of the proceedings had it been his intention to submit the case on the law questions alone, but from the first it had been his purpose, in case the demurrers should be overruled, to file an amended answer pleading to the merits. The court took this request under advisement and suspended the permanent restraining order which had just been entered, pending a decision thereon. 'Shortly thereafter, to wit, on March 17th, this request was denied, and the permanent restraining order again made effective. A motion filed March 12, 1920, by appellants, asking that the Corporation Commission be made a party to the suit, and an application, made on the same date by the Corporation Commission itself, for permission to intervene in the cause, were also denied at the same time.
Numerous errors are assigned, but appellants ’ brief is devoted largely to those dealing with the action of the court in not sustaining the demurrers, which raise the question of the jurisdiction of the court over acts of the Corporation Commission. The demurrers were overruled because the order of the Corporation Commission directing appellees to cease business on and after December 31, 1919, was, in the judgment of the court, a nullity, having been made by virtue of the-authority conferred upon the commission by chapter 130, Session Laws of 1919, which, as the trial court viewed it, is a void and unconstitutional piece of legis*139lation in so far as it- applies to one who like the appellees herein had, previous to its passage, expended large sums of money in erecting stations, purchasing equipment, and building up and establishing the goodwill and patronage of the public in their business of operating automobile stages for hire. The fact that the interest of appellees vested, according to the allegations, prior to the passage of the act held to be void, seems to have been the controlling factor in leading to a holding against the validity of the law.
In view of the conclusion we have reached regarding the errors assigned as a result of the denial of appellants’ request to file an amended answer, it will not be necessary to consider these assignments further than the mere statement of what they involve. Had appellants been permitted to amend, it might not have been necessary for the trial court to have held this act of the legislature void, inasmuch as the amended answer, as well as the proposed answer of the Corporation Commission accompanying its application to intervene, both filed March 12th contained allegations which, if true, would have been a complete defense, and have excluded from the ease the controlling question of vested property rights. A court should not, unless compelled by the exigencies of the case with which it is dealing, declare a legislative act invalid, for only a clear violation of constitutional provisions will justify such action regardless of the seeming unwisdom, unreasonableness, or injustice of the enactment against which the attack is directed. 36 Cyc. 971.
It is clear from a reading of what transpired on the 5th of March between the court and counsel for appellees, on the one hand, and counsel fon appellants, on the other, that a misunderstanding existed regarding the submission of the case on January 20th. But, even though the court understood that the case had *140been submitted for final determination on the amended complaint and demurrers alone, there appears no persuasive reason why appellants should not have been permitted to amend upon application therefor in view of the liberal provisions of our statute regarding amendments. Appellees could not have been injured thereby, for the temporary restraining order was still in force and could have been continued. Moreover, a correct determination of what the court regarded as the main issue involved, to wit, whether appellees were the owners of vested property rights of which they could not be deprived, could have been had only upon this-issue’s being raised by an amended answer denying such allegation, and the proposed amendment raised this question. If appellants were right in their contention that only the law questions had been submitted, they should have been permitted to amend as a matter of right, while, if the court and appellees were correct in their understanding, the amendment should have been permitted under the circumstances in the exercise of a wise discretion. Paragraph 422, Rev. Stats. Ariz. 1913.
The fact alone that the appellants’ answer contained only demurrers and a motion to dismiss would not justify the conclusion that it was their intention not to answer to the merits in case the law questions raised should be decided against them, notwithstanding the requirements of paragraph 467, Civil Code of 1913, that all the pleas of a defendant shall be “filed at the same time.” The provisions of paragraph 422, Civil Code of 1913, permitting an amendment any time before trial without leave of court and at any stage" of the action with such leave enables a defendant to test the law questions involved in his case before pleading to the merits. Perrin v. Mallory Com. Co., 8 Ariz. 404, 76 Pac. 476.
*141An injunction proceeding is one of equitable jurisdiction, but under tbe provisions of paragraph 1470, Revised Statutes of 1913, a defendant may answer in an injunction proceeding as in other civil actions; yet in paragraph 1479 of the Civil Code it is provided that “the principles, practice and procedure governing courts of equity shall govern proceedings in injunctions when the same are not in conflict with the provisions of this title or other law.” In demurring, therefore, before answering on the merits, appellants were following, not only the procedure of the Code as applied to a legal proceeding, but were also taking the course prescribed by the rules of equity pleading, as provided in paragraph 1479. The rule in equity is that the defendant answer on the overruling of his demurrer. Rush, Equity Pleading and Practice (1919 ed.), § 134.
The judgment appealed from is reversed and the case remanded to the superior court of Yuma county, with instructions to permit appellants to file an amended answer.
ROSS, C. J., and BAKER, J., concur.