Skip to content

Commit

Permalink
Merge pull request #4 from core23/develop
Browse files Browse the repository at this point in the history
Fixed CS
  • Loading branch information
core23 committed May 11, 2019
2 parents 9643674 + 1de6fa3 commit 24b34da
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 66 deletions.
7 changes: 4 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.* export-ignore
Makefile export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
docs/* export-ignore
tests/* export-ignore
vendor-bin/ export-ignore
/docs export-ignore
/tests export-ignore
/vendor-bin export-ignore
3 changes: 2 additions & 1 deletion src/Adapter/ORM/AbstractEntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@

abstract class AbstractEntityManager extends BaseEntityManager
{
use EntityManagerTrait, BaseQueryTrait;
use EntityManagerTrait;
use BaseQueryTrait;
}
2 changes: 1 addition & 1 deletion tests/Adapter/ORM/EntityManagerTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public function testCreateQueryBuilder(): void

$manager = new DemoEntityManager($repository->reveal());

$this->assertSame($queryBuilder->reveal(), $manager->getQueryBuilder('alias', 'someindex'));
static::assertSame($queryBuilder->reveal(), $manager->getQueryBuilder('alias', 'someindex'));
}
}
6 changes: 3 additions & 3 deletions tests/Bridge/Symfony/Bundle/Core23DoctrineBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ public function testItIsInstantiable(): void
{
$bundle = new Core23DoctrineBundle();

$this->assertInstanceOf(BundleInterface::class, $bundle);
static::assertInstanceOf(BundleInterface::class, $bundle);
}

public function testGetPath(): void
{
$bundle = new Core23DoctrineBundle();

$this->assertStringEndsWith('Bridge/Symfony/Bundle', \dirname($bundle->getPath()));
static::assertStringEndsWith('Bridge/Symfony/Bundle', \dirname($bundle->getPath()));
}

public function testGetContainerExtension(): void
{
$bundle = new Core23DoctrineBundle();

$this->assertInstanceOf(Core23DoctrineExtension::class, $bundle->getContainerExtension());
static::assertInstanceOf(Core23DoctrineExtension::class, $bundle->getContainerExtension());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function testLoadDefault(): void
{
$this->load();

$this->assertTrue(true);
static::assertTrue(true);
}

protected function getContainerExtensions()
Expand Down
4 changes: 2 additions & 2 deletions tests/EventListener/ORM/ConfirmableListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public function testItIsInstantiable(): void
{
$listener = new ConfirmableListener();

$this->assertInstanceOf(EventSubscriber::class, $listener);
static::assertInstanceOf(EventSubscriber::class, $listener);
}

public function testGetSubscribedEvents(): void
{
$listener = new ConfirmableListener();

$this->assertSame([
static::assertSame([
Events::loadClassMetadata,
], $listener->getSubscribedEvents());
}
Expand Down
4 changes: 2 additions & 2 deletions tests/EventListener/ORM/DeletableListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public function testItIsInstantiable(): void
{
$listener = new DeletableListener();

$this->assertInstanceOf(EventSubscriber::class, $listener);
static::assertInstanceOf(EventSubscriber::class, $listener);
}

public function testGetSubscribedEvents(): void
{
$listener = new DeletableListener();

$this->assertSame([
static::assertSame([
Events::loadClassMetadata,
], $listener->getSubscribedEvents());
}
Expand Down
8 changes: 4 additions & 4 deletions tests/EventListener/ORM/LifecycleDateListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public function testItIsInstantiable(): void
{
$listener = new LifecycleDateListener();

$this->assertInstanceOf(EventSubscriber::class, $listener);
static::assertInstanceOf(EventSubscriber::class, $listener);
}

public function testGetSubscribedEvents(): void
{
$listener = new LifecycleDateListener();

$this->assertSame([
static::assertSame([
Events::prePersist,
Events::preUpdate,
Events::loadClassMetadata,
Expand Down Expand Up @@ -76,7 +76,7 @@ public function testPrePersistForInvalidClass(): void
$listener = new LifecycleDateListener();
$listener->prePersist($eventArgs->reveal());

$this->assertTrue(true);
static::assertTrue(true);
}

public function testPreUpdate(): void
Expand Down Expand Up @@ -107,7 +107,7 @@ public function testPreUpdateForInvalidClass(): void
$listener = new LifecycleDateListener();
$listener->preUpdate($eventArgs->reveal());

$this->assertTrue(true);
static::assertTrue(true);
}

public function testLoadClassMetadataWithNoValidData(): void
Expand Down
8 changes: 4 additions & 4 deletions tests/EventListener/ORM/SortableListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public function testItIsInstantiable(): void
{
$listener = new SortableListener();

$this->assertInstanceOf(EventSubscriber::class, $listener);
static::assertInstanceOf(EventSubscriber::class, $listener);
}

public function testGetSubscribedEvents(): void
{
$listener = new SortableListener();

$this->assertSame([
static::assertSame([
Events::prePersist,
Events::preUpdate,
Events::preRemove,
Expand All @@ -57,7 +57,7 @@ public function testPrePersistForInvalidClass(): void
$listener = new SortableListener();
$listener->prePersist($eventArgs->reveal());

$this->assertTrue(true);
static::assertTrue(true);
}

public function testPreRemoveForInvalidClass(): void
Expand All @@ -72,7 +72,7 @@ public function testPreRemoveForInvalidClass(): void
$listener = new SortableListener();
$listener->preRemove($eventArgs->reveal());

$this->assertTrue(true);
static::assertTrue(true);
}

public function testLoadClassMetadataWithNoValidData(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/EventListener/ORM/TablePrefixEventListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ public function testItIsInstantiable(): void
{
$listener = new TablePrefixEventListener('acme_');

$this->assertInstanceOf(EventSubscriber::class, $listener);
static::assertInstanceOf(EventSubscriber::class, $listener);
}

public function testGetSubscribedEvents(): void
{
$listener = new TablePrefixEventListener('acme_');

$this->assertSame([
static::assertSame([
Events::loadClassMetadata,
], $listener->getSubscribedEvents());
}
Expand Down
8 changes: 4 additions & 4 deletions tests/EventListener/ORM/UniqueActiveListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public function testItIsInstantiable(): void
{
$listener = new UniqueActiveListener();

$this->assertInstanceOf(EventSubscriber::class, $listener);
static::assertInstanceOf(EventSubscriber::class, $listener);
}

public function testGetSubscribedEvents(): void
{
$listener = new UniqueActiveListener();

$this->assertSame([
static::assertSame([
Events::prePersist,
Events::preUpdate,
Events::loadClassMetadata,
Expand All @@ -56,7 +56,7 @@ public function testPrePersistForInvalidClass(): void
$listener = new UniqueActiveListener();
$listener->prePersist($eventArgs->reveal());

$this->assertTrue(true);
static::assertTrue(true);
}

public function testPreUpdateForInvalidClass(): void
Expand All @@ -71,7 +71,7 @@ public function testPreUpdateForInvalidClass(): void
$listener = new UniqueActiveListener();
$listener->preUpdate($eventArgs->reveal());

$this->assertTrue(true);
static::assertTrue(true);
}

public function testLoadClassMetadataWithNoValidData(): void
Expand Down
5 changes: 4 additions & 1 deletion tests/Fixtures/ClassWithAllProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@

final class ClassWithAllProperties implements DeletableInterface, ConfirmableInterface, LifecycleDateTimeInterface, PositionAwareInterface, UniqueActiveInterface
{
use DeleteableTrait, ConfirmableTrait, LifecycleDateTimeTrait, SortableTrait;
use DeleteableTrait;
use ConfirmableTrait;
use LifecycleDateTimeTrait;
use SortableTrait;

/**
* @var bool
Expand Down
12 changes: 6 additions & 6 deletions tests/Manager/ORM/BaseQueryTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testAddOrder(): void
->shouldBeCalled()
;

$this->assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
static::assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
$builder->reveal(),
['position'],
'myalias'
Expand All @@ -48,7 +48,7 @@ public function testAddOrderWithOrder(): void
->shouldBeCalled()
;

$this->assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
static::assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
$builder->reveal(),
['position'],
'myalias',
Expand All @@ -68,7 +68,7 @@ public function testAddOrderWithMultpleSorts(): void
->shouldBeCalled()
;

$this->assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
static::assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
$builder->reveal(),
['position', 'otherfield'],
'myalias',
Expand All @@ -91,7 +91,7 @@ public function testAddOrderWithMultpleSortAndOrders(): void
->shouldBeCalled()
;

$this->assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
static::assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
$builder->reveal(),
[
'position',
Expand All @@ -112,7 +112,7 @@ public function testAddOrderWithChildOrder(): void
->shouldBeCalled()
;

$this->assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
static::assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
$builder->reveal(),
['child.position'],
'myalias',
Expand All @@ -129,7 +129,7 @@ public function testAddOrderWithAliasChildOrder(): void
->shouldBeCalled()
;

$this->assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
static::assertSame($builder->reveal(), $this->manager->addOrderToQueryBuilder(
$builder->reveal(),
['f.position'],
'myalias',
Expand Down
6 changes: 3 additions & 3 deletions tests/Manager/ORM/SearchQueryTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testSearchWhere(): void
->shouldBeCalled()
;

$this->assertSame($orx->reveal(), $this->manager->searchWhereQueryBuilder(
static::assertSame($orx->reveal(), $this->manager->searchWhereQueryBuilder(
$builder->reveal(),
'field',
['foo']
Expand All @@ -77,7 +77,7 @@ public function testStrictSearchWhere(): void
->shouldBeCalled()
;

$this->assertSame($orx->reveal(), $this->manager->searchWhereQueryBuilder(
static::assertSame($orx->reveal(), $this->manager->searchWhereQueryBuilder(
$builder->reveal(),
'field',
['foo'],
Expand Down Expand Up @@ -109,7 +109,7 @@ public function testSearchWhereMultipleValues(): void
->shouldBeCalled()
;

$this->assertSame($orx->reveal(), $this->manager->searchWhereQueryBuilder(
static::assertSame($orx->reveal(), $this->manager->searchWhereQueryBuilder(
$builder->reveal(),
'field',
['foo', 'bar', 'baz'],
Expand Down
16 changes: 8 additions & 8 deletions tests/Model/Traits/ConfirmableTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ public function testIsConfirmedWithDefault(): void
{
$model = $this->createTraitMock();

$this->assertNull($model->getConfirmedAt());
static::assertNull($model->getConfirmedAt());
}

public function testGetConfirmedAtWithDefault(): void
{
$model = $this->createTraitMock();

$this->assertFalse($model->isConfirmed());
static::assertFalse($model->isConfirmed());
}

public function testSetUnConfirmed(): void
{
$model = $this->createTraitMock();
$model->setConfirmed(true);

$this->assertTrue($model->isConfirmed());
$this->assertNotNull($model->getConfirmedAt());
static::assertTrue($model->isConfirmed());
static::assertNotNull($model->getConfirmedAt());

$model->setConfirmed(false);

$this->assertFalse($model->isConfirmed());
$this->assertNull($model->getConfirmedAt());
static::assertFalse($model->isConfirmed());
static::assertNull($model->getConfirmedAt());
}

public function testSetConfirmedAt(): void
Expand All @@ -50,8 +50,8 @@ public function testSetConfirmedAt(): void
$model = $this->createTraitMock();
$model->setConfirmedAt($now);

$this->assertSame($now, $model->getConfirmedAt());
$this->assertTrue($model->isConfirmed());
static::assertSame($now, $model->getConfirmedAt());
static::assertTrue($model->isConfirmed());
}

private function createTraitMock()
Expand Down

0 comments on commit 24b34da

Please sign in to comment.