Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
210 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Tienvx\Bundle\MbtBundle\Entity\Bug; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
use Doctrine\ORM\Mapping\Embeddable; | ||
use Tienvx\Bundle\MbtBundle\Model\Bug\Video as VideoModel; | ||
|
||
/** | ||
* @Embeddable | ||
*/ | ||
class Video extends VideoModel | ||
{ | ||
/** | ||
* @ORM\Column(type="boolean") | ||
*/ | ||
protected bool $recording = false; | ||
|
||
/** | ||
* @ORM\Column(type="text", nullable=true) | ||
*/ | ||
protected ?string $errorMessage = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Tienvx\Bundle\MbtBundle\Model\Bug; | ||
|
||
class Video implements VideoInterface | ||
{ | ||
protected bool $recording = false; | ||
protected ?string $errorMessage = null; | ||
|
||
public function isRecording(): bool | ||
{ | ||
return $this->recording; | ||
} | ||
|
||
public function setRecording(bool $recording): void | ||
{ | ||
$this->recording = $recording; | ||
} | ||
|
||
public function getErrorMessage(): ?string | ||
{ | ||
return $this->errorMessage; | ||
} | ||
|
||
public function setErrorMessage(?string $errorMessage = null): void | ||
{ | ||
$this->errorMessage = $errorMessage; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Tienvx\Bundle\MbtBundle\Model\Bug; | ||
|
||
interface VideoInterface | ||
{ | ||
public function isRecording(): bool; | ||
|
||
public function setRecording(bool $recording): void; | ||
|
||
public function getErrorMessage(): ?string; | ||
|
||
public function setErrorMessage(?string $errorMessage = null): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Tienvx\Bundle\MbtBundle\Tests\Entity\Bug; | ||
|
||
use Tienvx\Bundle\MbtBundle\Entity\Bug\Video; | ||
use Tienvx\Bundle\MbtBundle\Model\Bug\VideoInterface; | ||
use Tienvx\Bundle\MbtBundle\Tests\Model\Bug\VideoTest as VideoModelTest; | ||
|
||
/** | ||
* @covers \Tienvx\Bundle\MbtBundle\Entity\Bug\Video | ||
* | ||
* @uses \Tienvx\Bundle\MbtBundle\Model\Bug\Video | ||
*/ | ||
class VideoTest extends VideoModelTest | ||
{ | ||
protected function createVideo(): VideoInterface | ||
{ | ||
return new Video(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Tienvx\Bundle\MbtBundle\Tests\Model\Bug; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Tienvx\Bundle\MbtBundle\Model\Bug\Video; | ||
use Tienvx\Bundle\MbtBundle\Model\Bug\VideoInterface; | ||
|
||
/** | ||
* @covers \Tienvx\Bundle\MbtBundle\Model\Bug\Video | ||
*/ | ||
class VideoTest extends TestCase | ||
{ | ||
protected VideoInterface $video; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->video = $this->createVideo(); | ||
} | ||
|
||
public function testRecording(): void | ||
{ | ||
$this->assertFalse($this->video->isRecording()); | ||
$this->video->setRecording(true); | ||
$this->assertTrue($this->video->isRecording()); | ||
} | ||
|
||
public function testErrorMessage(): void | ||
{ | ||
$this->assertNull($this->video->getErrorMessage()); | ||
$this->video->setErrorMessage('Something wrong'); | ||
$this->assertSame('Something wrong', $this->video->getErrorMessage()); | ||
} | ||
|
||
protected function createVideo(): VideoInterface | ||
{ | ||
return new Video(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.