@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | $configFieldName = 'type'; |
| 16 | 16 | $documentFieldName = 'd_type'; |
| 17 | 17 | $configFieldValue = 'article'; |
| 18 | - $entityConfig = [ |
|
| 18 | + $entityConfig = [ |
|
| 19 | 19 | 'config' => [ |
| 20 | - [ 'name' => $configFieldName, 'value' => $configFieldValue ] |
|
| 20 | + ['name' => $configFieldName, 'value' => $configFieldValue] |
|
| 21 | 21 | ] |
| 22 | 22 | ]; |
| 23 | 23 | |
@@ -49,6 +49,6 @@ discard block |
||
| 49 | 49 | $hydrator |
| 50 | 50 | ); |
| 51 | 51 | |
| 52 | - $this->assertEquals( sprintf('%s:"%s"', $documentFieldName, $configFieldValue) ,$query->getQueryString()); |
|
| 52 | + $this->assertEquals(sprintf('%s:"%s"', $documentFieldName, $configFieldValue), $query->getQueryString()); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | \ No newline at end of file |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $configFields = $schema->getConfigEntityFields(); |
| 62 | 62 | |
| 63 | 63 | $discriminator = false; |
| 64 | - foreach($configFields as $configField) { |
|
| 64 | + foreach ($configFields as $configField) { |
|
| 65 | 65 | $this->assertInstanceOf('Mdiyakov\DoctrineSolrBundle\Schema\Field\ConfigEntityField', $configField); |
| 66 | 66 | $discriminator = $discriminator ? $discriminator : $configField->isDiscriminator(); |
| 67 | 67 | $this->assertArrayHasKey($configField->getConfigFieldName(), $configFieldNames); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->assertEquals('d_id', $primaryKeyField->getDocumentFieldName()); |
| 81 | 81 | |
| 82 | 82 | $fields = $schema->getFields(); |
| 83 | - foreach($fields as $field) { |
|
| 83 | + foreach ($fields as $field) { |
|
| 84 | 84 | $this->assertInstanceOf('Mdiyakov\DoctrineSolrBundle\Schema\Field\Entity\Field', $field); |
| 85 | 85 | $this->assertArrayHasKey($field->getEntityFieldName(), $fieldNames); |
| 86 | 86 | $this->assertArrayHasKey($field->getDocumentFieldName(), $documentFieldNames); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $entity->date = $value; |
| 31 | 31 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 32 | - $this->assertEquals('2018-01-04T09:30:00Z',$fieldValue); |
|
| 32 | + $this->assertEquals('2018-01-04T09:30:00Z', $fieldValue); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function testGetDocumentValueForNull() |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $entity->date = $value; |
| 43 | 43 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 44 | - $this->assertEquals(null,$fieldValue); |
|
| 44 | + $this->assertEquals(null, $fieldValue); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -20,11 +20,11 @@ |
||
| 20 | 20 | |
| 21 | 21 | $entity->enabled = $string; |
| 22 | 22 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 23 | - $this->assertEquals(true ,$fieldValue); |
|
| 23 | + $this->assertEquals(true, $fieldValue); |
|
| 24 | 24 | |
| 25 | 25 | $entity->enabled = $int; |
| 26 | 26 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 27 | - $this->assertEquals(true ,$fieldValue); |
|
| 27 | + $this->assertEquals(true, $fieldValue); |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | $entity->enabled = $bool; |
@@ -38,16 +38,16 @@ |
||
| 38 | 38 | |
| 39 | 39 | $entity->title = $int; |
| 40 | 40 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 41 | - $this->assertEquals(strval($int) ,$fieldValue); |
|
| 41 | + $this->assertEquals(strval($int), $fieldValue); |
|
| 42 | 42 | |
| 43 | 43 | $entity->title = $bool; |
| 44 | 44 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 45 | - $this->assertEquals(strval($bool) ,$fieldValue); |
|
| 45 | + $this->assertEquals(strval($bool), $fieldValue); |
|
| 46 | 46 | |
| 47 | 47 | $entity->title = $null; |
| 48 | 48 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 49 | 49 | |
| 50 | - $this->assertEquals($null ,$fieldValue); |
|
| 50 | + $this->assertEquals($null, $fieldValue); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public function testGetDocumentValueForObject() |
@@ -18,15 +18,15 @@ |
||
| 18 | 18 | |
| 19 | 19 | $entity->price = $double; |
| 20 | 20 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 21 | - $this->assertEquals(123,$fieldValue); |
|
| 21 | + $this->assertEquals(123, $fieldValue); |
|
| 22 | 22 | |
| 23 | 23 | $entity->price = $int; |
| 24 | 24 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 25 | - $this->assertEquals(123,$fieldValue); |
|
| 25 | + $this->assertEquals(123, $fieldValue); |
|
| 26 | 26 | |
| 27 | 27 | $entity->price = $null; |
| 28 | 28 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 29 | - $this->assertEquals(0,$fieldValue); |
|
| 29 | + $this->assertEquals(0, $fieldValue); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -17,11 +17,11 @@ |
||
| 17 | 17 | |
| 18 | 18 | $entity->price = $double; |
| 19 | 19 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 20 | - $this->assertEquals(123.83 ,$fieldValue); |
|
| 20 | + $this->assertEquals(123.83, $fieldValue); |
|
| 21 | 21 | |
| 22 | 22 | $entity->price = $int; |
| 23 | 23 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 24 | - $this->assertEquals(123.00 ,$fieldValue); |
|
| 24 | + $this->assertEquals(123.00, $fieldValue); |
|
| 25 | 25 | |
| 26 | 26 | } |
| 27 | 27 | |
@@ -20,38 +20,38 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $entity->tags = $string; |
| 22 | 22 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 23 | - $this->assertEquals([$string] ,$fieldValue); |
|
| 23 | + $this->assertEquals([$string], $fieldValue); |
|
| 24 | 24 | |
| 25 | 25 | $entity->tags = $int; |
| 26 | 26 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 27 | - $this->assertEquals([$int] ,$fieldValue); |
|
| 27 | + $this->assertEquals([$int], $fieldValue); |
|
| 28 | 28 | |
| 29 | 29 | $entity->tags = $bool; |
| 30 | 30 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 31 | - $this->assertEquals([$bool] ,$fieldValue); |
|
| 31 | + $this->assertEquals([$bool], $fieldValue); |
|
| 32 | 32 | |
| 33 | 33 | $entity->tags = $null; |
| 34 | 34 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 35 | - $this->assertEquals([] ,$fieldValue); |
|
| 35 | + $this->assertEquals([], $fieldValue); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | public function testGetDocumentValueForArray() |
| 40 | 40 | { |
| 41 | - $array = [1,'string', false]; |
|
| 41 | + $array = [1, 'string', false]; |
|
| 42 | 42 | |
| 43 | 43 | $entity = new \stdClass(); |
| 44 | 44 | $field = new ArrayField('tags', 'd_tags', false, 10, false); |
| 45 | 45 | |
| 46 | 46 | $entity->tags = $array; |
| 47 | 47 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 48 | - $this->assertEquals($array ,$fieldValue); |
|
| 48 | + $this->assertEquals($array, $fieldValue); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | public function testGetDocumentValueForIterator() |
| 53 | 53 | { |
| 54 | - $array = [1,3,4,4,5,6,9]; |
|
| 54 | + $array = [1, 3, 4, 4, 5, 6, 9]; |
|
| 55 | 55 | $iterator = new \ArrayIterator($array); |
| 56 | 56 | |
| 57 | 57 | $entity = new \stdClass(); |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | $entity->tags = $iterator; |
| 61 | 61 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 62 | 62 | |
| 63 | - $this->assertEquals($array ,$fieldValue); |
|
| 63 | + $this->assertEquals($array, $fieldValue); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | public function testGetDocumentValueForIteratorAggregate() |
| 67 | 67 | { |
| 68 | - $array = [1,3,4,4,5,6,9]; |
|
| 68 | + $array = [1, 3, 4, 4, 5, 6, 9]; |
|
| 69 | 69 | $arrayObject = new \ArrayObject($array); |
| 70 | 70 | |
| 71 | 71 | $entity = new \stdClass(); |
@@ -74,6 +74,6 @@ discard block |
||
| 74 | 74 | $entity->tags = $arrayObject; |
| 75 | 75 | $fieldValue = $field->getDocumentFieldValue($entity); |
| 76 | 76 | |
| 77 | - $this->assertEquals($array ,$fieldValue); |
|
| 77 | + $this->assertEquals($array, $fieldValue); |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | \ No newline at end of file |
@@ -120,8 +120,8 @@ |
||
| 120 | 120 | { |
| 121 | 121 | $config = $this->configFixtures[$configName]; |
| 122 | 122 | |
| 123 | - $config['indexed_entities']['my_entity']['class'] = 'Mdiyakov\DoctrineSolrBundle\Tests\Config\Entity\MyEntity'; |
|
| 124 | - $config['indexed_entities']['my_entity']['finder_class'] = 'Mdiyakov\DoctrineSolrBundle\Tests\Config\MyEntityFinder'; |
|
| 123 | + $config['indexed_entities']['my_entity']['class'] = 'Mdiyakov\DoctrineSolrBundle\Tests\Config\Entity\MyEntity'; |
|
| 124 | + $config['indexed_entities']['my_entity']['finder_class'] = 'Mdiyakov\DoctrineSolrBundle\Tests\Config\MyEntityFinder'; |
|
| 125 | 125 | |
| 126 | 126 | return $config; |
| 127 | 127 | } |