Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Jul 23, 2024
1 parent 3fda27d commit cca7a47
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function testHighlightsAreSetOnTransformedObjects($elasticaResults, $doct
$results = $transformer->transform($elasticaResults);

foreach ($results as $result) {
$this->assertInternalType('array', $result->highlights);
$this->assertIsArray($result->highlights);
$this->assertNotEmpty($result->highlights);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Finder/TransformedFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testSearchMethodCreatesAQueryAndReturnsResultsFromSearchableDepe

$results = $method->invoke($finder, '', 10);

$this->assertInternalType('array', $results);
$this->assertIsArray($results);
}

public function testFindPaginatedReturnsAConfiguredPagerfantaObject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ public function testGetIdentifierFieldReturnsAMapOfIdentifiers()
{
$collection = new ElasticaToModelTransformerCollection([]);
$identifiers = $collection->getIdentifierField();
$this->assertInternalType('array', $identifiers);
$this->assertIsArray($identifiers);
$this->assertEmpty($identifiers);

$this->collectionSetup();
$identifiers = $this->collection->getIdentifierField();
$this->assertInternalType('array', $identifiers);
$this->assertIsArray($identifiers);
$this->assertSame(['type1' => 'id', 'type2' => 'id'], $identifiers);
}

Expand Down Expand Up @@ -154,7 +154,7 @@ public function testHybridTransformDecoratesResultsWithHybridResultObjects($resu

$hybridResults = $collection->hybridTransform([$result]);

$this->assertInternalType('array', $hybridResults);
$this->assertIsArray($hybridResults);
$this->assertNotEmpty($hybridResults);
$this->assertContainsOnlyInstancesOf(HybridResult::class, $hybridResults);

Expand Down
16 changes: 8 additions & 8 deletions tests/Unit/Transformer/ModelToElasticaAutoTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public function testNestedMapping()
$data = $document->getData();

$this->assertTrue(array_key_exists('sub', $data));
$this->assertInternalType('array', $data['sub']);
$this->assertIsArray($data['sub']);
$this->assertSame([
['foo' => 'foo'],
['foo' => 'bar'],
Expand All @@ -349,7 +349,7 @@ public function tesObjectMapping()
$data = $document->getData();

$this->assertTrue(array_key_exists('sub', $data));
$this->assertInternalType('array', $data['sub']);
$this->assertIsArray($data['sub']);
$this->assertSame([
['bar' => 'foo'],
['bar' => 'bar'],
Expand All @@ -367,7 +367,7 @@ public function testObjectDoesNotRequireProperties()
$data = $document->getData();

$this->assertTrue(array_key_exists('obj', $data));
$this->assertInternalType('array', $data['obj']);
$this->assertIsArray($data['obj']);
$this->assertSame([
'foo' => 'foo',
'bar' => 'foo',
Expand Down Expand Up @@ -401,8 +401,8 @@ public function testObjectsMappingOfAtLeastOneAutoMappedObjectAndAtLeastOneManua

$this->assertTrue(array_key_exists('obj', $data));
$this->assertTrue(array_key_exists('nestedObject', $data));
$this->assertInternalType('array', $data['obj']);
$this->assertInternalType('array', $data['nestedObject']);
$this->assertIsArray($data['obj']);
$this->assertIsArray($data['nestedObject']);
$this->assertSame(
[
'foo' => 'foo',
Expand Down Expand Up @@ -475,7 +475,7 @@ public function testThatMappedObjectsDontNeedAnIdentifierField()
$data = $document->getData();

$this->assertTrue(array_key_exists('objWithoutIdentifier', $data));
$this->assertInternalType('array', $data['objWithoutIdentifier']);
$this->assertIsArray($data['objWithoutIdentifier']);
$this->assertSame([
'foo' => 'foo',
'bar' => 'foo',
Expand All @@ -497,7 +497,7 @@ public function testThatNestedObjectsDontNeedAnIdentifierField()
$data = $document->getData();

$this->assertTrue(array_key_exists('subWithoutIdentifier', $data));
$this->assertInternalType('array', $data['subWithoutIdentifier']);
$this->assertIsArray($data['subWithoutIdentifier']);
$this->assertSame([
['foo' => 'foo', 'bar' => 'foo'],
['foo' => 'bar', 'bar' => 'bar'],
Expand Down Expand Up @@ -532,7 +532,7 @@ public function testNestedTransformReturnsAnEmptyArrayForNullValues()
]);

$data = $document->getData();
$this->assertInternalType('array', $data['nullValue']);
$this->assertIsArray($data['nullValue']);
$this->assertEmpty($data['nullValue']);
}

Expand Down

0 comments on commit cca7a47

Please sign in to comment.