| @@ 19-42 (lines=24) @@ | ||
| 16 | $this->shouldHaveType(CategoryPatchMessage::class); |
|
| 17 | } |
|
| 18 | ||
| 19 | function it_should_build() |
|
| 20 | { |
|
| 21 | $translation = new CategoryTranslationMessage(); |
|
| 22 | $translation->setLocale('en'); |
|
| 23 | $translation->setTitle('English title'); |
|
| 24 | $translation->setDescription('English description'); |
|
| 25 | ||
| 26 | $this->setParentRootId(11); |
|
| 27 | $this->setEnabled(true); |
|
| 28 | $this->addTranslation($translation); |
|
| 29 | ||
| 30 | $transData = [ |
|
| 31 | 'title' => 'English title', |
|
| 32 | 'description' => 'English description', |
|
| 33 | ]; |
|
| 34 | ||
| 35 | $data = [ |
|
| 36 | 'parentRootId' => 11, |
|
| 37 | 'enabled' => true, |
|
| 38 | 'translations' => ['en' => $transData], |
|
| 39 | ]; |
|
| 40 | ||
| 41 | $this->build()->shouldReturn($data); |
|
| 42 | } |
|
| 43 | ||
| 44 | function it_should_create_from_category( |
|
| 45 | Category $category, |
|
| @@ 17-40 (lines=24) @@ | ||
| 14 | $this->shouldHaveType(CategoryPostMessage::class); |
|
| 15 | } |
|
| 16 | ||
| 17 | function it_should_build() |
|
| 18 | { |
|
| 19 | $translation = new CategoryTranslationMessage(); |
|
| 20 | $translation->setLocale('en'); |
|
| 21 | $translation->setTitle('English title'); |
|
| 22 | $translation->setDescription('English description'); |
|
| 23 | ||
| 24 | $this->setParentRootId(11); |
|
| 25 | $this->setEnabled(true); |
|
| 26 | $this->addTranslation($translation); |
|
| 27 | ||
| 28 | $transData = [ |
|
| 29 | 'title' => 'English title', |
|
| 30 | 'description' => 'English description', |
|
| 31 | ]; |
|
| 32 | ||
| 33 | $data = [ |
|
| 34 | 'parentRootId' => 11, |
|
| 35 | 'enabled' => true, |
|
| 36 | 'translations' => ['en' => $transData], |
|
| 37 | ]; |
|
| 38 | ||
| 39 | $this->build()->shouldReturn($data); |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||