|
@@ 152-162 (lines=11) @@
|
| 149 |
|
$this->assertEquals($expected, $actual); |
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
public function testSetGetIfRoundTrip() |
| 153 |
|
{ |
| 154 |
|
$if = m::mock(TIfExpressionType::class); |
| 155 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 156 |
|
|
| 157 |
|
$foo = new TOperandType(); |
| 158 |
|
$foo->setIf($if); |
| 159 |
|
$result = $foo->getIf(); |
| 160 |
|
$this->assertTrue($result instanceof TIfExpressionType, get_class($result)); |
| 161 |
|
$this->assertTrue($result->isOK()); |
| 162 |
|
} |
| 163 |
|
|
| 164 |
|
public function testSetBadRecord() |
| 165 |
|
{ |
|
@@ 182-192 (lines=11) @@
|
| 179 |
|
$this->assertEquals($expected, $actual); |
| 180 |
|
} |
| 181 |
|
|
| 182 |
|
public function testSetGetRecordRoundTrip() |
| 183 |
|
{ |
| 184 |
|
$if = m::mock(TRecordExpressionType::class); |
| 185 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 186 |
|
|
| 187 |
|
$foo = new TOperandType(); |
| 188 |
|
$foo->setRecord($if); |
| 189 |
|
$result = $foo->getRecord(); |
| 190 |
|
$this->assertTrue($result instanceof TRecordExpressionType, get_class($result)); |
| 191 |
|
$this->assertTrue($result->isOK()); |
| 192 |
|
} |
| 193 |
|
|
| 194 |
|
public function testSetBadCollection() |
| 195 |
|
{ |
|
@@ 212-222 (lines=11) @@
|
| 209 |
|
$this->assertEquals($expected, $actual); |
| 210 |
|
} |
| 211 |
|
|
| 212 |
|
public function testSetGetCollectionRoundTrip() |
| 213 |
|
{ |
| 214 |
|
$if = m::mock(TCollectionExpressionType::class); |
| 215 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 216 |
|
|
| 217 |
|
$foo = new TOperandType(); |
| 218 |
|
$foo->setCollection($if); |
| 219 |
|
$result = $foo->getCollection(); |
| 220 |
|
$this->assertTrue($result instanceof TCollectionExpressionType, get_class($result)); |
| 221 |
|
$this->assertTrue($result->isOK()); |
| 222 |
|
} |
| 223 |
|
|
| 224 |
|
public function testSetBadTypeAssert() |
| 225 |
|
{ |
|
@@ 242-252 (lines=11) @@
|
| 239 |
|
$this->assertEquals($expected, $actual); |
| 240 |
|
} |
| 241 |
|
|
| 242 |
|
public function testSetGetTypeAssertRoundTrip() |
| 243 |
|
{ |
| 244 |
|
$if = m::mock(TTypeAssertExpressionType::class); |
| 245 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 246 |
|
|
| 247 |
|
$foo = new TOperandType(); |
| 248 |
|
$foo->setTypeAssert($if); |
| 249 |
|
$result = $foo->getTypeAssert(); |
| 250 |
|
$this->assertTrue($result instanceof TTypeAssertExpressionType, get_class($result)); |
| 251 |
|
$this->assertTrue($result->isOK()); |
| 252 |
|
} |
| 253 |
|
|
| 254 |
|
public function testSetBadTypeTest() |
| 255 |
|
{ |
|
@@ 272-282 (lines=11) @@
|
| 269 |
|
$this->assertEquals($expected, $actual); |
| 270 |
|
} |
| 271 |
|
|
| 272 |
|
public function testSetGetTypeTestRoundTrip() |
| 273 |
|
{ |
| 274 |
|
$if = m::mock(TTypeTestExpressionType::class); |
| 275 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 276 |
|
|
| 277 |
|
$foo = new TOperandType(); |
| 278 |
|
$foo->setTypeTest($if); |
| 279 |
|
$result = $foo->getTypeTest(); |
| 280 |
|
$this->assertTrue($result instanceof TTypeTestExpressionType, get_class($result)); |
| 281 |
|
$this->assertTrue($result->isOK()); |
| 282 |
|
} |
| 283 |
|
|
| 284 |
|
public function testSetBadFunctionReference() |
| 285 |
|
{ |
|
@@ 302-312 (lines=11) @@
|
| 299 |
|
$this->assertEquals($expected, $actual); |
| 300 |
|
} |
| 301 |
|
|
| 302 |
|
public function testSetGetFunctionReferenceRoundTrip() |
| 303 |
|
{ |
| 304 |
|
$if = m::mock(TFunctionReferenceExpressionType::class); |
| 305 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 306 |
|
|
| 307 |
|
$foo = new TOperandType(); |
| 308 |
|
$foo->setFunctionReference($if); |
| 309 |
|
$result = $foo->getFunctionReference(); |
| 310 |
|
$this->assertTrue($result instanceof TFunctionReferenceExpressionType, get_class($result)); |
| 311 |
|
$this->assertTrue($result->isOK()); |
| 312 |
|
} |
| 313 |
|
|
| 314 |
|
public function testSetBadEntitySetReference() |
| 315 |
|
{ |
|
@@ 332-342 (lines=11) @@
|
| 329 |
|
$this->assertEquals($expected, $actual); |
| 330 |
|
} |
| 331 |
|
|
| 332 |
|
public function testSetGetEntitySetReferenceRoundTrip() |
| 333 |
|
{ |
| 334 |
|
$if = m::mock(TEntitySetReferenceExpressionType::class); |
| 335 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 336 |
|
|
| 337 |
|
$foo = new TOperandType(); |
| 338 |
|
$foo->setEntitySetReference($if); |
| 339 |
|
$result = $foo->getEntitySetReference(); |
| 340 |
|
$this->assertTrue($result instanceof TEntitySetReferenceExpressionType, get_class($result)); |
| 341 |
|
$this->assertTrue($result->isOK()); |
| 342 |
|
} |
| 343 |
|
|
| 344 |
|
public function testSetBadAnonymousFunction() |
| 345 |
|
{ |
|
@@ 362-372 (lines=11) @@
|
| 359 |
|
$this->assertEquals($expected, $actual); |
| 360 |
|
} |
| 361 |
|
|
| 362 |
|
public function testSetGetAnonymousFunctionRoundTrip() |
| 363 |
|
{ |
| 364 |
|
$if = m::mock(TAnonymousFunctionExpressionType::class); |
| 365 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 366 |
|
|
| 367 |
|
$foo = new TOperandType(); |
| 368 |
|
$foo->setAnonymousFunction($if); |
| 369 |
|
$result = $foo->getAnonymousFunction(); |
| 370 |
|
$this->assertTrue($result instanceof TAnonymousFunctionExpressionType, get_class($result)); |
| 371 |
|
$this->assertTrue($result->isOK()); |
| 372 |
|
} |
| 373 |
|
|
| 374 |
|
public function testSetBadParameterReference() |
| 375 |
|
{ |
|
@@ 392-402 (lines=11) @@
|
| 389 |
|
$this->assertEquals($expected, $actual); |
| 390 |
|
} |
| 391 |
|
|
| 392 |
|
public function testSetGetParameterReferenceRoundTrip() |
| 393 |
|
{ |
| 394 |
|
$if = m::mock(TParameterReferenceExpressionType::class); |
| 395 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 396 |
|
|
| 397 |
|
$foo = new TOperandType(); |
| 398 |
|
$foo->setParameterReference($if); |
| 399 |
|
$result = $foo->getParameterReference(); |
| 400 |
|
$this->assertTrue($result instanceof TParameterReferenceExpressionType, get_class($result)); |
| 401 |
|
$this->assertTrue($result->isOK()); |
| 402 |
|
} |
| 403 |
|
|
| 404 |
|
public function testSetBadApply() |
| 405 |
|
{ |
|
@@ 422-432 (lines=11) @@
|
| 419 |
|
$this->assertEquals($expected, $actual); |
| 420 |
|
} |
| 421 |
|
|
| 422 |
|
public function testSetGetApplyRoundTrip() |
| 423 |
|
{ |
| 424 |
|
$if = m::mock(TApplyExpressionType::class); |
| 425 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 426 |
|
|
| 427 |
|
$foo = new TOperandType(); |
| 428 |
|
$foo->setApply($if); |
| 429 |
|
$result = $foo->getApply(); |
| 430 |
|
$this->assertTrue($result instanceof TApplyExpressionType, get_class($result)); |
| 431 |
|
$this->assertTrue($result->isOK()); |
| 432 |
|
} |
| 433 |
|
|
| 434 |
|
public function testSetBadPropertyReference() |
| 435 |
|
{ |
|
@@ 452-462 (lines=11) @@
|
| 449 |
|
$this->assertEquals($expected, $actual); |
| 450 |
|
} |
| 451 |
|
|
| 452 |
|
public function testSetGetPropertyReferenceRoundTrip() |
| 453 |
|
{ |
| 454 |
|
$if = m::mock(TPropertyReferenceExpressionType::class); |
| 455 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 456 |
|
|
| 457 |
|
$foo = new TOperandType(); |
| 458 |
|
$foo->setPropertyReference($if); |
| 459 |
|
$result = $foo->getPropertyReference(); |
| 460 |
|
$this->assertTrue($result instanceof TPropertyReferenceExpressionType, get_class($result)); |
| 461 |
|
$this->assertTrue($result->isOK()); |
| 462 |
|
} |
| 463 |
|
|
| 464 |
|
public function testSetBadValueTermReference() |
| 465 |
|
{ |
|
@@ 482-492 (lines=11) @@
|
| 479 |
|
$this->assertEquals($expected, $actual); |
| 480 |
|
} |
| 481 |
|
|
| 482 |
|
public function testSetGetValueTermReferenceRoundTrip() |
| 483 |
|
{ |
| 484 |
|
$if = m::mock(TValueTermReferenceExpressionType::class); |
| 485 |
|
$if->shouldReceive('isOK')->andReturn(true); |
| 486 |
|
|
| 487 |
|
$foo = new TOperandType(); |
| 488 |
|
$foo->setValueTermReference($if); |
| 489 |
|
$result = $foo->getValueTermReference(); |
| 490 |
|
$this->assertTrue($result instanceof TValueTermReferenceExpressionType, get_class($result)); |
| 491 |
|
$this->assertTrue($result->isOK()); |
| 492 |
|
} |
| 493 |
|
|
| 494 |
|
public function testGExpressionNotValidWhenMoreThanOneBasicExpressionSet() |
| 495 |
|
{ |