Changes in tests: namespaces, properties, calls.

This commit is contained in:
Alexey Skobkin 2023-08-18 16:06:30 +03:00
parent 82b541c0fc
commit 6c173b2e5c
No known key found for this signature in database
GPG key ID: 5D5CEF6F221278E7
4 changed files with 12 additions and 11 deletions

View file

@ -2,7 +2,7 @@
namespace Tests\Skobkin\PointToolsBundle\Controller;
use src\PointToolsBundle\DataFixtures\ORM\LoadPostData;
use App\DataFixtures\LoadPostData;
use Symfony\Bundle\FrameworkBundle\{Client, Test\WebTestCase};
use Symfony\Component\DomCrawler\Crawler;

View file

@ -1,8 +1,9 @@
<?php
declare(strict_types=1);
namespace Tests\Skobkin\PointToolsBundle\DTO;
use src\PointToolsBundle\DTO\TopUserDTO;
use App\DTO\TopUserDTO;
class TopUserTest extends \PHPUnit_Framework_TestCase
{
@ -16,8 +17,8 @@ class TopUserTest extends \PHPUnit_Framework_TestCase
*/
public function testGetLogin(TopUserDTO $topUser)
{
$this->assertInternalType('string', $topUser->getLogin());
$this->assertEquals('testuser', $topUser->getLogin());
$this->assertInternalType('string', $topUser->login);
$this->assertEquals('testuser', $topUser->login);
}
/**
@ -25,7 +26,7 @@ class TopUserTest extends \PHPUnit_Framework_TestCase
*/
public function testGetSubscribersCount(TopUserDTO $topUser)
{
$this->assertInternalType('int', $topUser->getSubscribersCount());
$this->assertEquals(3, $topUser->getSubscribersCount());
$this->assertInternalType('int', $topUser->subscribersCount);
$this->assertEquals(3, $topUser->subscribersCount);
}
}

View file

@ -2,8 +2,8 @@
namespace Tests\Skobkin\PointToolsBundle\Repository;
use App\DTO\TopUserDTO;
use Doctrine\ORM\EntityManager;
use src\PointToolsBundle\DTO\TopUserDTO;
use src\PointToolsBundle\Entity\User;
use src\PointToolsBundle\Repository\UserRepository;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

View file

@ -2,13 +2,13 @@
namespace Tests\Skobkin\PointToolsBundle\Service\Factory;
use App\DTO\Api\User as UserDTO;
use App\Exception\Factory\InvalidUserDataException;
use App\Factory\UserFactory;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use src\PointToolsBundle\DTO\Api\User as UserDTO;
use src\PointToolsBundle\Entity\User;
use src\PointToolsBundle\Exception\Factory\InvalidUserDataException;
use src\PointToolsBundle\Repository\UserRepository;
use src\PointToolsBundle\Service\Factory\UserFactory;
class UserFactoryTest extends TestCase
{