Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Sep 4, 2021
1 parent 7063d1a commit 6e0736f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions tests/Spread/AdminSpreadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ public function testSupportsMethod(): void
$action = new Action();
$action->setVerb('a.not.supported.verb');

$this->assertFalse($spread->supports($action), '"a.not.supported.verb" should not be supported');
static::assertFalse($spread->supports($action), '"a.not.supported.verb" should not be supported');

// Test supported verbs
foreach ($this->supportedVerbs as $supportedVerb) {
$action = new Action();
$action->setVerb($supportedVerb);

$this->assertTrue($spread->supports($action), sprintf('Verb "%s" should be supported', $action->getVerb()));
static::assertTrue($spread->supports($action), sprintf('Verb "%s" should be supported', $action->getVerb()));
}
}

Expand All @@ -87,7 +87,7 @@ public function testProcessMethod(): void
$collection = new EntryCollection();
$spread->process($action, $collection);

$this->assertCount(2, $collection->getIterator(), 'Should return 2');
static::assertCount(2, $collection->getIterator(), 'Should return 2');

$usersCount = 0;

Expand All @@ -96,12 +96,12 @@ public function testProcessMethod(): void
foreach ($users as $entry) {
++$usersCount;

$this->assertInstanceOf(EntryUnaware::class, $entry, 'Should return an instance of EntryUnaware');
$this->assertSame(FakeUserEntity::class, $entry->getSubjectModel());
static::assertInstanceOf(EntryUnaware::class, $entry, 'Should return an instance of EntryUnaware');
static::assertSame(FakeUserEntity::class, $entry->getSubjectModel());
}
}

$this->assertSame(5, $usersCount / 2, 'Should return 5 users for 2 iterations');
static::assertSame(5, $usersCount / 2, 'Should return 5 users for 2 iterations');
}

protected function getFakeUsers(): array
Expand Down
50 changes: 25 additions & 25 deletions tests/Twig/Extension/SonataTimelineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function setUp(): void
$this->pool = $this->createMock(Pool::class);
$this->pool
->method('getAdminByClass')
->with($this->equalTo('Acme\DemoBundle\Model\Demo'))
->with(static::equalTo('Acme\DemoBundle\Model\Demo'))
->willReturn($this->admin);

$this->twigExtension = new SonataTimelineExtension($this->pool);
Expand All @@ -58,26 +58,26 @@ public function testGenerateLink(): void

$action = new Action();

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('hasRoute')
->with($this->equalTo('edit'))
->with(static::equalTo('edit'))
->willReturn(true);
$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('isGranted')
->with($this->equalTo('EDIT'))
->with(static::equalTo('EDIT'))
->willReturn(true);

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('generateObjectUrl')
->with($this->equalTo('edit'), $this->anything())
->with(static::equalTo('edit'), static::anything())
->willReturn('acme/demo/2/edit');

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('toString')
->with($this->anything())
->with(static::anything())
->willReturn('Text');

$this->assertSame('<a href="acme/demo/2/edit">Text</a>', $this->twigExtension->generateLink($component, $action));
static::assertSame('<a href="acme/demo/2/edit">Text</a>', $this->twigExtension->generateLink($component, $action));
}

public function testGenerateLinkDisabledEdit(): void
Expand All @@ -99,22 +99,22 @@ public function testGenerateLinkDisabledEdit(): void
true
);

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('isGranted')
->with($this->equalTo('SHOW'))
->with(static::equalTo('SHOW'))
->willReturn(true);

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('generateObjectUrl')
->with($this->equalTo('show'), $this->anything())
->with(static::equalTo('show'), static::anything())
->willReturn('acme/demo/2/show');

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('toString')
->with($this->anything())
->with(static::anything())
->willReturn('Text');

$this->assertSame('<a href="acme/demo/2/show">Text</a>', $this->twigExtension->generateLink($component, $action));
static::assertSame('<a href="acme/demo/2/show">Text</a>', $this->twigExtension->generateLink($component, $action));
}

public function testGenerateLinkNoEditPermission(): void
Expand Down Expand Up @@ -147,17 +147,17 @@ public function testGenerateLinkNoEditPermission(): void
true
);

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('generateObjectUrl')
->with($this->equalTo('show'), $this->anything())
->with(static::equalTo('show'), static::anything())
->willReturn('acme/demo/2/show');

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('toString')
->with($this->anything())
->with(static::anything())
->willReturn('Text');

$this->assertSame('<a href="acme/demo/2/show">Text</a>', $this->twigExtension->generateLink($component, $action));
static::assertSame('<a href="acme/demo/2/show">Text</a>', $this->twigExtension->generateLink($component, $action));
}

public function testGenerateLinkDisabledEditAndShow(): void
Expand All @@ -179,11 +179,11 @@ public function testGenerateLinkDisabledEditAndShow(): void
false
);

$this->admin->expects($this->once())
$this->admin->expects(static::once())
->method('toString')
->with($this->anything())
->with(static::anything())
->willReturn('Text');

$this->assertSame('Text', $this->twigExtension->generateLink($component, $action));
static::assertSame('Text', $this->twigExtension->generateLink($component, $action));
}
}

0 comments on commit 6e0736f

Please sign in to comment.