@@ -55,5 +55,77 @@ public function testJoin(): void {
5555 }
5656 }
5757
58+ public function testQuoteNameSimple (): void {
59+ $ database = TestHelper::getDatabase ();
60+ if ($ database != NULL ) {
61+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
62+ $ this ->assertEquals ('`aName` ' , $ criteria ->quoteName (NULL , 'aName ' ));
63+ }
64+ }
65+
66+ public function testQuoteNameSimple2 (): void {
67+ $ database = TestHelper::getDatabase ();
68+ if ($ database != NULL ) {
69+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
70+ $ this ->assertEquals ('`aName` ' , $ criteria ->quoteName ('aName ' ));
71+ }
72+ }
73+
74+ public function testQuoteNameCriteriaAlias (): void {
75+ $ database = TestHelper::getDatabase ();
76+ if ($ database != NULL ) {
77+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
78+ $ this ->assertEquals ('`a`.`aName` ' , $ criteria ->quoteName ('a ' , 'aName ' ));
79+ }
80+ }
81+
82+ public function testQuoteNameExplicitAlias (): void {
83+ $ database = TestHelper::getDatabase ();
84+ if ($ database != NULL ) {
85+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
86+ $ this ->assertEquals ('`b`.`aName` ' , $ criteria ->quoteName ('a ' , array ('b ' , 'aName ' )));
87+ }
88+ }
89+
90+ public function testQuoteNameExplicitAlias2 (): void {
91+ $ database = TestHelper::getDatabase ();
92+ if ($ database != NULL ) {
93+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
94+ $ this ->assertEquals ('`b`.`aName` ' , $ criteria ->quoteName (array ('b ' , 'aName ' )));
95+ }
96+ }
97+
98+ public function testPrepareValueString (): void {
99+ $ database = TestHelper::getDatabase ();
100+ if ($ database != NULL ) {
101+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
102+ $ this ->assertEquals ('\'aString \'' , $ criteria ->prepareValue ('aString ' , FALSE ));
103+ }
104+ }
105+
106+ public function testPrepareValueStringIgnoreCase (): void {
107+ $ database = TestHelper::getDatabase ();
108+ if ($ database != NULL ) {
109+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
110+ $ this ->assertEquals ('\'astring \'' , $ criteria ->prepareValue ('aString ' , TRUE ));
111+ }
112+ }
113+
114+ public function testPrepareValueNoString (): void {
115+ $ database = TestHelper::getDatabase ();
116+ if ($ database != NULL ) {
117+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
118+ $ this ->assertEquals (13 , $ criteria ->prepareValue (13 , FALSE ));
119+ }
120+ }
121+
122+ public function testPrepareValueNoStringIgnoreCase (): void {
123+ $ database = TestHelper::getDatabase ();
124+ if ($ database != NULL ) {
125+ $ criteria = new CriteriaImpl ($ database , 'dual ' );
126+ $ this ->assertEquals (13 , $ criteria ->prepareValue (13 , TRUE ));
127+ }
128+ }
129+
58130
59131}
0 commit comments