for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the MilioooMessageBundle package.
*
* (c) Michiel boeckaert <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Miliooo\Messaging\Tests\ValueObjects;
use Miliooo\Messaging\ValueObjects\ThreadStatus;
use Miliooo\Messaging\Model\ThreadMetaInterface;
/**
* Test file for Thread Status Value Object
* @author Michiel Boeckaert <[email protected]>
class ThreadStatusTest extends \PHPUnit_Framework_TestCase
{
* @dataProvider invalidThreadStatusProvider
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Invalid thread status
public function testInvalidThreadStatuses($status)
new ThreadStatus($status);
}
* Invalid statuses provider.
* @return array
public function invalidThreadStatusProvider()
return [
['foo'],
[null],
[100],
[[]]
];
* Valid statuses provider.
public function validThreadStatusProvider()
[ThreadMetaInterface::STATUS_ARCHIVED],
[ThreadMetaInterface::STATUS_ACTIVE],
* @dataProvider validThreadStatusProvider
public function testValidReadStatuses($status)
$statusValueObject = new ThreadStatus($status);
$this->assertEquals($status, $statusValueObject->getThreadStatus());