Code Duplication    Length = 13-13 lines in 2 locations

dev/SapphireTest.php 2 locations

@@ 406-418 (lines=13) @@
403
	 * @param string $identifier The identifier string, as provided in your fixture file
404
	 * @return int
405
	 */
406
	protected function idFromFixture($className, $identifier) {
407
		$id = $this->getFixtureFactory()->getId($className, $identifier);
408
409
		if(!$id) {
410
			user_error(sprintf(
411
				"Couldn't find object '%s' (class: %s)",
412
				$identifier,
413
				$className
414
			), E_USER_ERROR);
415
		}
416
417
		return $id;
418
	}
419
420
	/**
421
	 * Return all of the IDs in the fixture of a particular class name.
@@ 439-451 (lines=13) @@
436
	 *
437
	 * @return DataObject
438
	 */
439
	protected function objFromFixture($className, $identifier) {
440
		$obj = $this->getFixtureFactory()->get($className, $identifier);
441
442
		if(!$obj) {
443
			user_error(sprintf(
444
				"Couldn't find object '%s' (class: %s)",
445
				$identifier,
446
				$className
447
			), E_USER_ERROR);
448
		}
449
450
		return $obj;
451
	}
452
453
	/**
454
	 * Load a YAML fixture file into the database.