1
0
Fork 0
mirror of synced 2025-03-30 11:40:15 +03:00

#1229 - code style fixes (alignment/spacing)

This commit is contained in:
Marco Pivetta 2015-02-16 02:06:22 +00:00
parent baeab5d4f4
commit 1f67218dc5
3 changed files with 128 additions and 113 deletions

View file

@ -186,11 +186,12 @@ class AssociationBuilder
/**
* Sets field as primary key.
*
* @return AssociationBuilder
* @return self
*/
public function isPrimaryKey()
{
$this->mapping['id'] = true;
return $this;
}

View file

@ -335,7 +335,9 @@ class ClassMetadataBuilderTest extends \Doctrine\Tests\OrmTestCase
public function testCreateManyToOneWithIdentity()
{
$this->assertIsFluent(
$this->builder->createManyToOne('groups', 'Doctrine\Tests\Models\CMS\CmsGroup')
$this
->builder
->createManyToOne('groups', 'Doctrine\Tests\Models\CMS\CmsGroup')
->addJoinColumn('group_id', 'id', true, false, 'CASCADE')
->cascadeAll()
->fetchExtraLazy()
@ -343,7 +345,9 @@ class ClassMetadataBuilderTest extends \Doctrine\Tests\OrmTestCase
->build()
);
$this->assertEquals(array('groups' => array (
$this->assertEquals(
array(
'groups' => array(
'fieldName' => 'groups',
'targetEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsGroup',
'cascade' => array(
@ -390,7 +394,9 @@ class ClassMetadataBuilderTest extends \Doctrine\Tests\OrmTestCase
'orphanRemoval' => false,
'id' => true
),
), $this->cm->associationMappings);
),
$this->cm->associationMappings
);
}
public function testCreateOneToOne()
@ -455,7 +461,9 @@ class ClassMetadataBuilderTest extends \Doctrine\Tests\OrmTestCase
public function testCreateOneToOneWithIdentity()
{
$this->assertIsFluent(
$this->builder->createOneToOne('groups', 'Doctrine\Tests\Models\CMS\CmsGroup')
$this
->builder
->createOneToOne('groups', 'Doctrine\Tests\Models\CMS\CmsGroup')
->addJoinColumn('group_id', 'id', true, false, 'CASCADE')
->cascadeAll()
->fetchExtraLazy()
@ -463,7 +471,9 @@ class ClassMetadataBuilderTest extends \Doctrine\Tests\OrmTestCase
->build()
);
$this->assertEquals(array('groups' => array (
$this->assertEquals(
array(
'groups' => array(
'fieldName' => 'groups',
'targetEntity' => 'Doctrine\\Tests\\Models\\CMS\\CmsGroup',
'cascade' => array(
@ -510,14 +520,18 @@ class ClassMetadataBuilderTest extends \Doctrine\Tests\OrmTestCase
),
'orphanRemoval' => false
),
), $this->cm->associationMappings);
),
$this->cm->associationMappings
);
}
public function testThrowsExceptionOnCreateOneToOneWithIdentityOnInverseSide()
{
$this->setExpectedException('Doctrine\ORM\Mapping\MappingException');
$this->builder->createOneToOne('groups', 'Doctrine\Tests\Models\CMS\CmsGroup')
$this
->builder
->createOneToOne('groups', 'Doctrine\Tests\Models\CMS\CmsGroup')
->mappedBy('test')
->fetchExtraLazy()
->isPrimaryKey()