| @@ 480-492 (lines=13) @@ | ||
| 477 | * @param string $identifier The identifier string, as provided in your fixture file |
|
| 478 | * @return int |
|
| 479 | */ |
|
| 480 | protected function idFromFixture($className, $identifier) |
|
| 481 | { |
|
| 482 | $id = $this->getFixtureFactory()->getId($className, $identifier); |
|
| 483 | ||
| 484 | if (!$id) { |
|
| 485 | user_error(sprintf( |
|
| 486 | "Couldn't find object '%s' (class: %s)", |
|
| 487 | $identifier, |
|
| 488 | $className |
|
| 489 | ), E_USER_ERROR); |
|
| 490 | } |
|
| 491 | ||
| 492 | return $id; |
|
| 493 | } |
|
| 494 | ||
| 495 | /** |
|
| @@ 515-527 (lines=13) @@ | ||
| 512 | * |
|
| 513 | * @return DataObject |
|
| 514 | */ |
|
| 515 | protected function objFromFixture($className, $identifier) |
|
| 516 | { |
|
| 517 | $obj = $this->getFixtureFactory()->get($className, $identifier); |
|
| 518 | ||
| 519 | if (!$obj) { |
|
| 520 | user_error(sprintf( |
|
| 521 | "Couldn't find object '%s' (class: %s)", |
|
| 522 | $identifier, |
|
| 523 | $className |
|
| 524 | ), E_USER_ERROR); |
|
| 525 | } |
|
| 526 | ||
| 527 | return $obj; |
|
| 528 | } |
|
| 529 | ||
| 530 | /** |
|