for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Axstrad library.
*
* (c) Dan Kempster <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
* @author Dan Kempster <[email protected]>
* @package Axstrad\Common
* @subpackage Tests
*/
namespace Axstrad\Common\Tests\Traits;
use Axstrad\Component\Test\TraitTestCase;
* Axstrad\Common\Tests\Traits\TitleTraitTest
* covers Axstrad\Common\Traits\TitleTrait::getTitle
* covers Axstrad\Common\Traits\TitleTrait::setTitle
* @group unittest
* @uses Axstrad\Common\Traits\TitleTrait
class TitleTraitTest extends TraitTestCase
{
protected $trait = 'Axstrad\Common\Traits\NameTrait';
public function testTitleTrait()
$this->fixture = $this->getMockForTrait('Axstrad\Common\Traits\TitleTrait');
$this->assertNull(
$this->fixture->getTitle(),
'$title doesn\'t start as NULL'
);
$this->assertEquals(
$this->fixture,
$this->fixture->setTitle('Bar'),
'setTitle() didn\'t return self'
'Bar',
$this->fixture->getTitle()
$this->fixture->setTitle(null);
'',
'$title should be an empty string when null is passed'
}