Skip to content

Commit df27524

Browse files
author
Andrew Zhdanovskih
committed
Update tests
1 parent 9f23ce3 commit df27524

File tree

3 files changed

+20
-27
lines changed

3 files changed

+20
-27
lines changed

tests/Kernel.php

-7
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ public function registerBundles()
2929
];
3030
}
3131

32-
/**
33-
* @inheritDoc
34-
*/
35-
protected function configureRoutes(\Symfony\Component\Routing\RouteCollectionBuilder $routes)
36-
{
37-
}
38-
3932
/**
4033
* @inheritDoc
4134
*/

tests/Loader/DbLoaderTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DbLoaderTest extends KernelTestCase
1919
public function testIsServiceConfigured(): void
2020
{
2121
self::bootKernel();
22-
$this->assertInstanceOf(DbLoader::class, self::$container->get('translation.loader.db'));
22+
self::assertInstanceOf(DbLoader::class, self::$container->get('translation.loader.db'));
2323
}
2424

2525
protected function setUp(): void
@@ -51,7 +51,7 @@ public function testLoadCatalogue(): void
5151
{
5252
$service = self::$container->get('translation.loader.db');
5353
$cat = $service->load(null, 'en', 'db_messages');
54-
$this->assertInstanceOf(MessageCatalogue::class, $cat);
55-
$this->assertSame('This is a translation of key', $cat->get('translatable.key', 'db_messages'));
54+
self::assertInstanceOf(MessageCatalogue::class, $cat);
55+
self::assertSame('This is a translation of key', $cat->get('translatable.key', 'db_messages'));
5656
}
5757
}

tests/TranslationTest.php

+17-17
Original file line numberDiff line numberDiff line change
@@ -25,53 +25,53 @@ public function setUp(): void
2525

2626
public function testGetId()
2727
{
28-
$this->assertNull($this->entity->getId());
28+
self::assertNull($this->entity->getId());
2929
}
3030

3131
public function testSetDomain()
3232
{
33-
$this->assertInstanceOf(Translation::class, $this->entity->setDomain('domain'));
33+
self::assertInstanceOf(Translation::class, $this->entity->setDomain('domain'));
3434
}
3535

3636
public function testSetLocale()
3737
{
38-
$this->assertInstanceOf(Translation::class, $this->entity->setLocale('ru'));
38+
self::assertInstanceOf(Translation::class, $this->entity->setLocale('ru'));
3939
}
4040

4141
public function testGetKey()
4242
{
43-
$this->assertNull($this->entity->getKey());
43+
self::assertNull($this->entity->getKey());
4444
}
4545

4646
public function testGetDomain()
4747
{
48-
$this->assertNull($this->entity->getDomain());
48+
self::assertNull($this->entity->getDomain());
4949
$this->entity->setDomain('domain');
50-
$this->assertEquals('domain', $this->entity->getDomain());
50+
self::assertEquals('domain', $this->entity->getDomain());
5151
}
5252

5353
public function testGetTranslation()
5454
{
55-
$this->assertNull($this->entity->getTranslation());
55+
self::assertNull($this->entity->getTranslation());
5656
$this->entity->setTranslation('translation');
57-
$this->assertEquals('translation', $this->entity->getTranslation());
57+
self::assertEquals('translation', $this->entity->getTranslation());
5858
}
5959

6060
public function testGetLocale()
6161
{
62-
$this->assertNull($this->entity->getLocale());
62+
self::assertNull($this->entity->getLocale());
6363
$this->entity->setLocale('en');
64-
$this->assertEquals('en', $this->entity->getLocale());
64+
self::assertEquals('en', $this->entity->getLocale());
6565
}
6666

6767
public function testSetTranslation()
6868
{
69-
$this->assertInstanceOf(Translation::class, $this->entity->setTranslation('translation'));
69+
self::assertInstanceOf(Translation::class, $this->entity->setTranslation('translation'));
7070
}
7171

7272
public function testSetKey()
7373
{
74-
$this->assertInstanceOf(Translation::class, $this->entity->setKey('key'));
74+
self::assertInstanceOf(Translation::class, $this->entity->setKey('key'));
7575
}
7676

7777
public function testLoad()
@@ -83,10 +83,10 @@ public function testLoad()
8383
'domain' => 'domain',
8484
];
8585

86-
$this->assertInstanceOf(Translation::class, $this->entity->load($params));
87-
$this->assertEquals('en', $this->entity->getLocale());
88-
$this->assertEquals('key', $this->entity->getKey());
89-
$this->assertEquals('translation', $this->entity->getTranslation());
90-
$this->assertEquals('domain', $this->entity->getDomain());
86+
self::assertInstanceOf(Translation::class, $this->entity->load($params));
87+
self::assertEquals('en', $this->entity->getLocale());
88+
self::assertEquals('key', $this->entity->getKey());
89+
self::assertEquals('translation', $this->entity->getTranslation());
90+
self::assertEquals('domain', $this->entity->getDomain());
9191
}
9292
}

0 commit comments

Comments
 (0)