| @@ -1,7 +1,7 @@ | |||||
| name: phpmyadmin | name: phpmyadmin | ||||
| repository: ddev/ddev-phpmyadmin | repository: ddev/ddev-phpmyadmin | ||||
| version: v0.3.3 | version: v0.3.3 | ||||
| install_date: "2024-01-23T13:35:25+01:00" | |||||
| install_date: "2024-03-19T17:20:12+01:00" | |||||
| project_files: | project_files: | ||||
| - docker-compose.phpmyadmin.yaml | - docker-compose.phpmyadmin.yaml | ||||
| - docker-compose.phpmyadmin-norouter.yaml | - docker-compose.phpmyadmin-norouter.yaml | ||||
| @@ -3,18 +3,17 @@ type: php | |||||
| docroot: public | docroot: public | ||||
| php_version: "8.2" | php_version: "8.2" | ||||
| webserver_type: nginx-fpm | webserver_type: nginx-fpm | ||||
| router_http_port: "8080" | |||||
| router_https_port: "8443" | |||||
| xdebug_enabled: false | xdebug_enabled: false | ||||
| additional_hostnames: [] | additional_hostnames: [] | ||||
| additional_fqdns: [] | additional_fqdns: [] | ||||
| database: | database: | ||||
| type: mariadb | type: mariadb | ||||
| version: "10.4" | version: "10.4" | ||||
| webimage_extra_packages: [php8.2-xdebug] | |||||
| use_dns_when_possible: true | use_dns_when_possible: true | ||||
| composer_version: "2" | composer_version: "2" | ||||
| web_environment: [] | web_environment: [] | ||||
| router_http_port: 8080 | |||||
| router_https_port: 8443 | |||||
| # Key features of DDEV's config.yaml: | # Key features of DDEV's config.yaml: | ||||
| @@ -1,15 +0,0 @@ | |||||
| # For docker-toolbox users; Docker has not yet supported the "host.docker.internal" | |||||
| # convention that is used from ddev v0.18.0. But if you add this file as | |||||
| # .ddev/docker-compose.xdebug.yaml it should sort that out. | |||||
| # Note that the IP address in your environment might not be 192.168.99.1, | |||||
| # Find out what address to use with "docker-machine ip default" | |||||
| # It will probably give 192.168.99.100. | |||||
| # Replace the last digit of the ip with "1", so 192.168.99.100 becomes 192.168.99.1 | |||||
| version: "3.6" | |||||
| services: | |||||
| web: | |||||
| extra_hosts: | |||||
| - "host.docker.internal:192.168.65.254" | |||||
| # Find out what address to use with "docker-machine ip default" | |||||
| # It will probably give 192.168.99.100. | |||||
| # Replace the last digit of the ip with "1", so 192.168.99.100 becomes 192.168.99.1 | |||||
| @@ -1,4 +1,4 @@ | |||||
| xdebug.mode=debug | |||||
| xdebug.start_with_request=yes | |||||
| xdebug.output_dir=/var/www/html/.ddev/xdebug | |||||
| xdebug.profiler_output_name=trace.%c%p%r%u.out | |||||
| ;xdebug.log = /home/danielknudsen/xdebug.log | |||||
| ;xdebug.client_port = 9003 | |||||
| ;xdebug.client_host=host.docker.internal | |||||
| xdebug.client_host=docker.for.mac.localhost | |||||
| @@ -1,3 +0,0 @@ | |||||
| ARG BASE_IMAGE | |||||
| FROM $BASE_IMAGE | |||||
| RUN enable_xdebug | |||||
| @@ -1,5 +1,11 @@ | |||||
| # matsen-tool-be | # matsen-tool-be | ||||
| # Most needed commands | |||||
| ddev exec bin/console make:migration | |||||
| ddev exec bin/console doctrine:migration:migrate | |||||
| ddev exec bin/console doctrine:fixtures:load | |||||
| ddev exec bin/console make:entity | |||||
| # Installation: | # Installation: | ||||
| gehe ins root Verzeichnis des Projekts und für aus: ddev config | gehe ins root Verzeichnis des Projekts und für aus: ddev config | ||||
| @@ -12,13 +18,23 @@ | |||||
| # Troubleshooting: | # Troubleshooting: | ||||
| Unable to listen on required ports, port 443 is already in use | |||||
| Unable to listen on required ports, port 443 is already in use: | |||||
| -> setze andere Ports in .ddev/config.yaml z.B. | -> setze andere Ports in .ddev/config.yaml z.B. | ||||
| router_http_port: 8080 | router_http_port: 8080 | ||||
| router_https_port: 8443 | router_https_port: 8443 | ||||
| - https://stackoverflow.com/questions/76507208/symfony-6-3-migration-causes-problems-with-stateless-authenticators-forcing-requ | - https://stackoverflow.com/questions/76507208/symfony-6-3-migration-causes-problems-with-stateless-authenticators-forcing-requ | ||||
| Xdebug not working at all: | |||||
| ddev logs -> xdebug problems? like: | |||||
| "NOTICE: PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: 172.27.0.1:9003 (from HTTP_X_FORWARDED_FOR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port)." | |||||
| - https://stackoverflow.com/questions/31324981/how-to-access-host-port-from-docker-container/43541732#43541732 | |||||
| -> create folder "php" in ".ddev"-folder, create a file "xdebug.ini" (here could be also a php.ini - settings made override ddev php.ini) and insert this line into xdebug.ini: xdebug.client_host=docker.for.mac.localhost | |||||
| -> ddev restart afterwards | |||||
| telnet: Unable to connect to remote host: Connection refused | |||||
| # PHPMyAdmin installieren: | # PHPMyAdmin installieren: | ||||
| ddev get ddev/ddev-phpmyadmin | ddev get ddev/ddev-phpmyadmin | ||||
| @@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration; | |||||
| /** | /** | ||||
| * Auto-generated Migration: Please modify to your needs! | * Auto-generated Migration: Please modify to your needs! | ||||
| */ | */ | ||||
| final class Version20240319155132 extends AbstractMigration | |||||
| final class Version20240320115901 extends AbstractMigration | |||||
| { | { | ||||
| public function getDescription(): string | public function getDescription(): string | ||||
| { | { | ||||
| @@ -21,7 +21,7 @@ final class Version20240319155132 extends AbstractMigration | |||||
| { | { | ||||
| // this up() migration is auto-generated, please modify it to your needs | // this up() migration is auto-generated, please modify it to your needs | ||||
| $this->addSql('CREATE TABLE comment (id INT AUTO_INCREMENT NOT NULL, owner_id INT NOT NULL, posting_id INT NOT NULL, message LONGTEXT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_9474526C7E3C61F9 (owner_id), INDEX IDX_9474526C9AE985F6 (posting_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | $this->addSql('CREATE TABLE comment (id INT AUTO_INCREMENT NOT NULL, owner_id INT NOT NULL, posting_id INT NOT NULL, message LONGTEXT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_9474526C7E3C61F9 (owner_id), INDEX IDX_9474526C9AE985F6 (posting_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||||
| $this->addSql('CREATE TABLE contact (id INT AUTO_INCREMENT NOT NULL, partner_id INT NOT NULL, image_id INT DEFAULT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birthday DATE DEFAULT NULL, position VARCHAR(255) DEFAULT NULL, phone VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_4C62E6389393F8FE (partner_id), INDEX IDX_4C62E6383DA5256D (image_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | |||||
| $this->addSql('CREATE TABLE contact (id INT AUTO_INCREMENT NOT NULL, partner_id INT NOT NULL, image_id INT DEFAULT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birthday DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', position VARCHAR(255) DEFAULT NULL, phone VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_4C62E6389393F8FE (partner_id), INDEX IDX_4C62E6383DA5256D (image_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | |||||
| $this->addSql('CREATE TABLE media_object (id INT AUTO_INCREMENT NOT NULL, file_path VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | $this->addSql('CREATE TABLE media_object (id INT AUTO_INCREMENT NOT NULL, file_path VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||||
| $this->addSql('CREATE TABLE partner (id INT AUTO_INCREMENT NOT NULL, logo_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, street VARCHAR(255) DEFAULT NULL, street_no VARCHAR(255) DEFAULT NULL, zip VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, country VARCHAR(255) DEFAULT NULL, website VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_312B3E16F98F144A (logo_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | $this->addSql('CREATE TABLE partner (id INT AUTO_INCREMENT NOT NULL, logo_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, street VARCHAR(255) DEFAULT NULL, street_no VARCHAR(255) DEFAULT NULL, zip VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, country VARCHAR(255) DEFAULT NULL, website VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_312B3E16F98F144A (logo_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||||
| $this->addSql('CREATE TABLE posting (id INT AUTO_INCREMENT NOT NULL, owner_id INT NOT NULL, partner_id INT NOT NULL, contact_id INT DEFAULT NULL, sale_id INT DEFAULT NULL, headline VARCHAR(255) NOT NULL, message LONGTEXT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_BD275D737E3C61F9 (owner_id), INDEX IDX_BD275D739393F8FE (partner_id), INDEX IDX_BD275D73E7A1254A (contact_id), INDEX IDX_BD275D734A7E4868 (sale_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | $this->addSql('CREATE TABLE posting (id INT AUTO_INCREMENT NOT NULL, owner_id INT NOT NULL, partner_id INT NOT NULL, contact_id INT DEFAULT NULL, sale_id INT DEFAULT NULL, headline VARCHAR(255) NOT NULL, message LONGTEXT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_BD275D737E3C61F9 (owner_id), INDEX IDX_BD275D739393F8FE (partner_id), INDEX IDX_BD275D73E7A1254A (contact_id), INDEX IDX_BD275D734A7E4868 (sale_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | ||||
| @@ -69,8 +69,9 @@ class CommentApi implements OwnerInterface | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?\DateTimeImmutable $createdAt = null; | public ?\DateTimeImmutable $createdAt = null; | ||||
| public function getOwner(): UserApi | |||||
| public function getOwner(): ?UserApi | |||||
| { | { | ||||
| //dd($this->owner); | |||||
| return $this->owner; | return $this->owner; | ||||
| } | } | ||||
| } | } | ||||
| @@ -62,7 +62,7 @@ class ContactApi | |||||
| #[NotBlank] | #[NotBlank] | ||||
| public ?PartnerApi $partner = null; | public ?PartnerApi $partner = null; | ||||
| public ?string $birthday = null; | |||||
| public ?\DateTimeImmutable $birthday = null; | |||||
| public ?MediaObject $image = null; | public ?MediaObject $image = null; | ||||
| @@ -106,7 +106,7 @@ class PostingApi implements OwnerInterface | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?\DateTimeImmutable $createdAt = null; | public ?\DateTimeImmutable $createdAt = null; | ||||
| public function getOwner(): UserApi | |||||
| public function getOwner(): ?UserApi | |||||
| { | { | ||||
| return $this->owner; | return $this->owner; | ||||
| } | } | ||||
| @@ -85,7 +85,7 @@ class SaleApi implements OwnerInterface | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public array $posts = []; | public array $posts = []; | ||||
| public function getOwner(): UserApi | |||||
| public function getOwner(): ?UserApi | |||||
| { | { | ||||
| return $this->owner; | return $this->owner; | ||||
| } | } | ||||
| @@ -65,7 +65,7 @@ class TaskNoteApi implements OwnerInterface | |||||
| #[ApiProperty(writable: false)] | #[ApiProperty(writable: false)] | ||||
| public ?\DateTimeImmutable $createdAt = null; | public ?\DateTimeImmutable $createdAt = null; | ||||
| public function getOwner(): UserApi | |||||
| public function getOwner(): ?UserApi | |||||
| { | { | ||||
| return $this->owner; | return $this->owner; | ||||
| } | } | ||||
| @@ -27,8 +27,8 @@ class Contact | |||||
| #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] | #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] | ||||
| private ?Partner $partner = null; | private ?Partner $partner = null; | ||||
| #[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)] | |||||
| private ?\DateTimeInterface $birthday = null; | |||||
| #[ORM\Column(nullable: true)] | |||||
| private ?\DateTimeImmutable $birthday = null; | |||||
| #[ORM\ManyToOne] | #[ORM\ManyToOne] | ||||
| #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] | #[ORM\JoinColumn(nullable: true, onDelete: "SET NULL")] | ||||
| @@ -97,21 +97,14 @@ class Contact | |||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getBirthday(): ?\DateTimeInterface | |||||
| public function getBirthday(): ?\DateTimeImmutable | |||||
| { | { | ||||
| return $this->birthday; | return $this->birthday; | ||||
| } | } | ||||
| public function getBirthdayAsString(): string | null | |||||
| { | |||||
| return $this->birthday?->format('Y-m-d'); | |||||
| } | |||||
| public function setBirthday(?\DateTimeInterface $birthday): static | |||||
| public function setBirthday(?\DateTimeImmutable $birthday): void | |||||
| { | { | ||||
| $this->birthday = $birthday; | $this->birthday = $birthday; | ||||
| return $this; | |||||
| } | } | ||||
| public function getImage(): ?MediaObject | public function getImage(): ?MediaObject | ||||
| @@ -50,7 +50,7 @@ final class ContactFactory extends ModelFactory | |||||
| return [ | return [ | ||||
| 'firstName' => self::faker()->firstName(), | 'firstName' => self::faker()->firstName(), | ||||
| 'lastName' => self::faker()->lastName(), | 'lastName' => self::faker()->lastName(), | ||||
| 'birthday' => \DateTime::createFromFormat('Y-m-d', self::faker()->date()), | |||||
| 'birthday' => \DateTimeImmutable::createFromFormat('Y-m-d', self::faker()->date()), | |||||
| 'position' => self::faker()->randomElement(FakeValues::POSITIONS), | 'position' => self::faker()->randomElement(FakeValues::POSITIONS), | ||||
| 'phone' => self::faker()->phoneNumber(), | 'phone' => self::faker()->phoneNumber(), | ||||
| 'email' => self::faker()->email(), | 'email' => self::faker()->email(), | ||||
| @@ -4,5 +4,5 @@ namespace App\Interface; | |||||
| use App\ApiResource\UserApi; | use App\ApiResource\UserApi; | ||||
| interface OwnerInterface { | interface OwnerInterface { | ||||
| public function getOwner(): UserApi; | |||||
| public function getOwner(): ?UserApi; | |||||
| } | } | ||||
| @@ -58,7 +58,6 @@ class CommentApiToEntityMapper implements MapperInterface | |||||
| $entity = $to; | $entity = $to; | ||||
| assert($entity instanceof Comment); | assert($entity instanceof Comment); | ||||
| $entity->setMessage($dto->message); | $entity->setMessage($dto->message); | ||||
| return $entity; | return $entity; | ||||
| } | } | ||||
| } | } | ||||
| @@ -57,10 +57,7 @@ class ContactApiToEntityMapper implements MapperInterface | |||||
| $entity->setFirstName($dto->firstName); | $entity->setFirstName($dto->firstName); | ||||
| $entity->setLastName($dto->lastName); | $entity->setLastName($dto->lastName); | ||||
| $birthDay = $dto->birthday !== null ? | |||||
| \DateTimeImmutable::createFromFormat('Y-m-d', $dto->birthday) : | |||||
| null; | |||||
| $entity->setBirthday($birthDay); | |||||
| $entity->setBirthday($dto->birthday); | |||||
| $entity->setImage($dto->image); | $entity->setImage($dto->image); | ||||
| $entity->setPosition($dto->position); | $entity->setPosition($dto->position); | ||||
| $entity->setPhone($dto->phone); | $entity->setPhone($dto->phone); | ||||
| @@ -47,7 +47,7 @@ class ContactEntityToApiMapper implements MapperInterface | |||||
| MicroMapperInterface::MAX_DEPTH => 1, | MicroMapperInterface::MAX_DEPTH => 1, | ||||
| ] | ] | ||||
| ); | ); | ||||
| $dto->birthday = $entity->getBirthdayAsString(); | |||||
| $dto->birthday = $entity->getBirthday(); | |||||
| $dto->image = $entity->getImage(); | $dto->image = $entity->getImage(); | ||||
| $dto->imageUrl = $this->fileUrlService->getFileUrl($entity->getImage()); | $dto->imageUrl = $this->fileUrlService->getFileUrl($entity->getImage()); | ||||
| $dto->position = $entity->getPosition(); | $dto->position = $entity->getPosition(); | ||||
| @@ -64,10 +64,7 @@ class TaskApiToEntityMapper implements MapperInterface | |||||
| assert($entity instanceof Task); | assert($entity instanceof Task); | ||||
| $entity->setHeadline($dto->headline); | $entity->setHeadline($dto->headline); | ||||
| $entity->setDescription($dto->description); | $entity->setDescription($dto->description); | ||||
| $dueAt = $dto->dueAt !== null ? | |||||
| \DateTimeImmutable::createFromFormat('Y-m-d', $dto->dueAt) : | |||||
| null; | |||||
| $entity->setDueAt($dueAt); | |||||
| $entity->setDueAt($dto->dueAt); | |||||
| $entity->setPartner(null); | $entity->setPartner(null); | ||||
| if ($dto->partner !== null) { | if ($dto->partner !== null) { | ||||
| assert($dto->partner instanceof PartnerApi); | assert($dto->partner instanceof PartnerApi); | ||||
| @@ -34,11 +34,11 @@ class OwnerApiEditVoter extends Voter | |||||
| switch ($attribute) { | switch ($attribute) { | ||||
| case self::EDIT: | case self::EDIT: | ||||
| if ($subject->getOwner()?->id === $user->getId()) { | if ($subject->getOwner()?->id === $user->getId()) { | ||||
| //dd('sddds'); | |||||
| return true; | return true; | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| @@ -13,6 +13,8 @@ use App\Factory\MediaObjectLogoFactory; | |||||
| use App\Factory\MediaObjectContactFactory; | use App\Factory\MediaObjectContactFactory; | ||||
| use App\Factory\PartnerFactory; | use App\Factory\PartnerFactory; | ||||
| use App\Factory\PostingFactory; | use App\Factory\PostingFactory; | ||||
| use App\Factory\ProductFactory; | |||||
| use App\Factory\SaleFactory; | |||||
| use App\Factory\UserFactory; | use App\Factory\UserFactory; | ||||
| use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; | use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; | ||||
| use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||||
| @@ -45,7 +47,9 @@ class CommentResourceTest extends KernelTestCase | |||||
| ] | ] | ||||
| ); | ); | ||||
| MediaObjectLogoFactory::createOne(); | MediaObjectLogoFactory::createOne(); | ||||
| ProductFactory::createOne(); | |||||
| PartnerFactory::createOne(); | PartnerFactory::createOne(); | ||||
| SaleFactory::createOne(); | |||||
| $posting = PostingFactory::createOne(); | $posting = PostingFactory::createOne(); | ||||
| CommentFactory::createOne(); | CommentFactory::createOne(); | ||||
| @@ -54,7 +54,7 @@ class ContactResourceTest extends KernelTestCase | |||||
| 'firstName' => 'Peter', | 'firstName' => 'Peter', | ||||
| 'lastName' => 'Test', | 'lastName' => 'Test', | ||||
| 'partner' => '/api/partners/' . $partner->getId(), | 'partner' => '/api/partners/' . $partner->getId(), | ||||
| 'birthday' => '1984-02-10', | |||||
| 'birthday' => '1984-02-10T00:00:00.000Z', | |||||
| 'image' => '/api/medias/' . $mediaObject->getId(), | 'image' => '/api/medias/' . $mediaObject->getId(), | ||||
| 'position' => 'CEO', | 'position' => 'CEO', | ||||
| 'phone' => '123456789', | 'phone' => '123456789', | ||||
| @@ -9,6 +9,9 @@ namespace App\Tests\Functional; | |||||
| use App\Enum\PartnerType; | use App\Enum\PartnerType; | ||||
| use App\Factory\MediaObjectLogoFactory; | use App\Factory\MediaObjectLogoFactory; | ||||
| use App\Factory\PartnerFactory; | |||||
| use App\Factory\ProductFactory; | |||||
| use App\Factory\SaleFactory; | |||||
| use App\Factory\UserFactory; | use App\Factory\UserFactory; | ||||
| use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; | use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; | ||||
| use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||||
| @@ -42,13 +45,17 @@ class PartnerResourceTest extends KernelTestCase | |||||
| ); | ); | ||||
| $mediaObject = MediaObjectLogoFactory::createOne(); | $mediaObject = MediaObjectLogoFactory::createOne(); | ||||
| PartnerFactory::createOne(); | |||||
| ProductFactory::createOne(); | |||||
| SaleFactory::createOne(); | |||||
| $token = $this->JWTManager->create($user->object()); | $token = $this->JWTManager->create($user->object()); | ||||
| $response = $this->browser() | $response = $this->browser() | ||||
| ->post('/api/partners' , [ | ->post('/api/partners' , [ | ||||
| 'json' => [ | 'json' => [ | ||||
| 'name' => 'test customer', | 'name' => 'test customer', | ||||
| 'type' => PartnerType::Customer, | |||||
| 'partnerType' => PartnerType::Customer, | |||||
| 'street' => 'test street', | 'street' => 'test street', | ||||
| 'streetNo' => '11', | 'streetNo' => '11', | ||||
| 'zip' => '22335', | 'zip' => '22335', | ||||
| @@ -73,8 +80,8 @@ class PartnerResourceTest extends KernelTestCase | |||||
| ], | ], | ||||
| ]) | ]) | ||||
| ->assertSuccessful() | ->assertSuccessful() | ||||
| ->assertJsonMatches('"hydra:totalItems"', 1) | |||||
| ->assertJsonMatches('"hydra:member"[0].name', 'test customer') | |||||
| ->assertJsonMatches('"hydra:totalItems"', 2) | |||||
| ->assertJsonMatches('"hydra:member"[1].name', 'test customer') | |||||
| ->content() | ->content() | ||||
| ; | ; | ||||
| @@ -12,6 +12,8 @@ use App\Factory\MediaObjectLogoFactory; | |||||
| use App\Factory\MediaObjectContactFactory; | use App\Factory\MediaObjectContactFactory; | ||||
| use App\Factory\PartnerFactory; | use App\Factory\PartnerFactory; | ||||
| use App\Factory\PostingFactory; | use App\Factory\PostingFactory; | ||||
| use App\Factory\ProductFactory; | |||||
| use App\Factory\SaleFactory; | |||||
| use App\Factory\UserFactory; | use App\Factory\UserFactory; | ||||
| use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; | use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; | ||||
| use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||||
| @@ -48,6 +50,8 @@ class PostingResourceTest extends KernelTestCase | |||||
| MediaObjectLogoFactory::createOne(); | MediaObjectLogoFactory::createOne(); | ||||
| $partner = PartnerFactory::createOne(); | $partner = PartnerFactory::createOne(); | ||||
| $contact = ContactFactory::createOne(); | $contact = ContactFactory::createOne(); | ||||
| ProductFactory::createOne(); | |||||
| SaleFactory::createOne(); | |||||
| PostingFactory::createOne(); | PostingFactory::createOne(); | ||||
| $token = $this->JWTManager->create($user->object()); | $token = $this->JWTManager->create($user->object()); | ||||
| @@ -76,17 +76,17 @@ class TaskNoteResourceTest extends KernelTestCase | |||||
| ]) | ]) | ||||
| ->assertSuccessful() | ->assertSuccessful() | ||||
| ; | ; | ||||
| $this->browser() | |||||
| ->get('/api/task_notes', [ | |||||
| 'headers' => [ | |||||
| 'Authorization' => 'Bearer ' . $token, | |||||
| ], | |||||
| ]) | |||||
| ->assertSuccessful() | |||||
| ->assertJsonMatches('"hydra:totalItems"', 2) | |||||
| ->assertJsonMatches('"hydra:member"[1].message', 'my comment') | |||||
| ; | |||||
| // | |||||
| // $this->browser() | |||||
| // ->get('/api/task_notes', [ | |||||
| // 'headers' => [ | |||||
| // 'Authorization' => 'Bearer ' . $token, | |||||
| // ], | |||||
| // ]) | |||||
| // ->assertSuccessful() | |||||
| // ->assertJsonMatches('"hydra:totalItems"', 2) | |||||
| // ->assertJsonMatches('"hydra:member"[1].message', 'my comment') | |||||
| // ; | |||||
| } | } | ||||
| } | } | ||||