Skip to content

Commit

Permalink
Creates series model class
Browse files Browse the repository at this point in the history
Issue: documentacao-e-tarefas/desenvolvimento_e_infra#892

Signed-off-by: Thiago <thiago@lepidus.com.br>
  • Loading branch information
thiagolepidus committed Oct 1, 2024
1 parent 4944c5a commit f710038
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 0 deletions.
100 changes: 100 additions & 0 deletions src/GraphQL/Model/Series.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?php

namespace ThothClient\GraphQL\Model;

class Series extends AbstractModel
{
public const SERIES_TYPE_JOURNAL = 'JOURNAL';

public const SERIES_TYPE_BOOK_SERIES = 'BOOK_SERIES';

public function getSeriesId(): string
{
return $this->getData('seriesId');
}

public function setSeriesId(string $seriesId): void
{
$this->setData('seriesId', $seriesId);
}

public function getSeriesType(): string
{
return $this->getData('seriesType');
}

public function setSeriesType(string $seriesType): void
{
$this->setData('seriesType', $seriesType);
}

public function getSeriesName(): string
{
return $this->getData('seriesName');
}

public function setSeriesName(string $seriesName): void
{
$this->setData('seriesName', $seriesName);
}

public function getIssnPrint(): string
{
return $this->getData('issnPrint');
}

public function setIssnPrint(string $issnPrint): void
{
$this->setData('issnPrint', $issnPrint);
}

public function getIssnDigital(): string
{
return $this->getData('issnDigital');
}

public function setIssnDigital(string $issnDigital): void
{
$this->setData('issnDigital', $issnDigital);
}

public function getSeriesUrl(): string
{
return $this->getData('seriesUrl');
}

public function setSeriesUrl(string $seriesUrl): void
{
$this->setData('seriesUrl', $seriesUrl);
}

public function getSeriesDescription(): string
{
return $this->getData('seriesDescription');
}

public function setSeriesDescription(string $seriesDescription): void
{
$this->setData('seriesDescription', $seriesDescription);
}

public function getSeriesCfpUrl(): string
{
return $this->getData('seriesCfpUrl');
}

public function setSeriesCfpUrl(string $seriesCfpUrl): void
{
$this->setData('seriesCfpUrl', $seriesCfpUrl);
}

public function getImprintId(): string
{
return $this->getData('imprintId');
}

public function setImprintId(string $imprintId): void
{
$this->setData('imprintId', $imprintId);
}
}
43 changes: 43 additions & 0 deletions tests/GraphQL/Model/SeriesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace ThothClient\Tests\GraphQL\Model;

use PHPUnit\Framework\TestCase;
use ThothClient\GraphQL\Model\Series;

final class SeriesTest extends TestCase
{
public function testGettersAndSetters(): void
{
$seriesId = '90f5e4ec-e591-4bd9-b06b-506670cb523e';
$seriesType = Series::SERIES_TYPE_JOURNAL;
$seriesName = 'Foobar';
$issnPrint = '2515-0758';
$issnDigital = '2515-0766';
$seriesUrl = 'http://foo.bar/';
$seriesDescription = 'Sed nunc dui, semper eu semper vel, bibendum in nulla.';
$seriesCfpUrl = 'http://foo.bar/baz/cfp';
$imprintId = 'c2a4eca1-9bb4-479f-98ad-09abc9756745';

$series = new Series();
$series->setSeriesId($seriesId);
$series->setSeriesType($seriesType);
$series->setSeriesName($seriesName);
$series->setIssnPrint($issnPrint);
$series->setIssnDigital($issnDigital);
$series->setSeriesUrl($seriesUrl);
$series->setSeriesDescription($seriesDescription);
$series->setSeriesCfpUrl($seriesCfpUrl);
$series->setImprintId($imprintId);

$this->assertSame($seriesId, $series->getSeriesId());
$this->assertSame($seriesType, $series->getSeriesType());
$this->assertSame($seriesName, $series->getSeriesName());
$this->assertSame($issnPrint, $series->getIssnPrint());
$this->assertSame($issnDigital, $series->getIssnDigital());
$this->assertSame($seriesUrl, $series->getSeriesUrl());
$this->assertSame($seriesDescription, $series->getSeriesDescription());
$this->assertSame($seriesCfpUrl, $series->getSeriesCfpUrl());
$this->assertSame($imprintId, $series->getImprintId());
}
}

0 comments on commit f710038

Please sign in to comment.