Created
June 4, 2019 15:40
-
-
Save alcaeus/30592b53acbd96d35d57391c515807bd to your computer and use it in GitHub Desktop.
Functional test for #2028
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Doctrine\ODM\MongoDB\Tests\Functional\Ticket; | |
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; | |
use Doctrine\ODM\MongoDB\Tests\BaseTest; | |
class GH2028Test extends BaseTest | |
{ | |
public function testStoreHashWithIntKeys() | |
{ | |
$document = new GH2028Document(); | |
$document->hash = [ | |
'foo' => 'bar', | |
123 => 'baz', | |
'456' => 'foo', | |
]; | |
$this->dm->persist($document); | |
$this->dm->flush(); | |
$this->dm->clear(); | |
$document = $this->dm->find(GH2028Document::class, $document->id); | |
self::assertSame([ | |
'foo' => 'bar', | |
123 => 'baz', | |
'456' => 'foo', | |
], $document->hash); | |
} | |
} | |
/** @ODM\Document */ | |
class GH2028Document | |
{ | |
/** @ODM\Id */ | |
public $id; | |
/** @ODM\Field(type="hash") */ | |
public $hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment