private function ContentEntityNormalizerTest::getContentHubEntityFromResult in Acquia Content Hub 8
Get the Content Hub Entity from our normalized array.
Parameters
array $normalized: The normalized array structure containing the content hub entity objects.
Return value
\Acquia\ContentHubClient\Entity The first ContentHub Entity from the resultset.
13 calls to ContentEntityNormalizerTest::getContentHubEntityFromResult()
- ContentEntityNormalizerTest::testNormalizeImageReferenceField in tests/
src/ Unit/ Normalizer/ ContentEntityNormalizerTest.php - Tests the normalize() method for image references.
- ContentEntityNormalizerTest::testNormalizeOneField in tests/
src/ Unit/ Normalizer/ ContentEntityNormalizerTest.php - Tests the normalize() method.
- ContentEntityNormalizerTest::testNormalizeOneFieldMultiValued in tests/
src/ Unit/ Normalizer/ ContentEntityNormalizerTest.php - Tests the normalize() method.
- ContentEntityNormalizerTest::testNormalizeReferenceField in tests/
src/ Unit/ Normalizer/ ContentEntityNormalizerTest.php - Tests the normalize() method.
- ContentEntityNormalizerTest::testNormalizeTypeReferenceField in tests/
src/ Unit/ Normalizer/ ContentEntityNormalizerTest.php - Tests the normalize() method.
File
- tests/
src/ Unit/ Normalizer/ ContentEntityNormalizerTest.php, line 800
Class
- ContentEntityNormalizerTest
- PHPUnit test for the ContentEntityNormalizer class.
Namespace
Drupal\Tests\acquia_contenthub\Unit\NormalizerCode
private function getContentHubEntityFromResult(array $normalized) {
// Since there is only 1 entity, we are fairly certain the first one is
// ours.
/** @var \Acquia\ContentHubClient\Entity $normalized_entity */
$normalized_entity = array_pop($normalized['entities']);
// Check if it is of the expected class.
$this
->assertTrue($normalized_entity instanceof Entity);
return $normalized_entity;
}