Completed
Push — master ( fef923...c0df34 )
by Rafael
03:03
created

AccessorWriterTest::testIsWritable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/**
4
 * LICENSE: This file is subject to the terms and conditions defined in
5
 * file 'LICENSE', which is part of this source code package.
6
 *
7
 * @copyright 2016 Copyright(c) - All rights reserved.
8
 */
9
10
namespace Rafrsr\LibArray2Object\Tests\Writer;
11
12
use Rafrsr\LibArray2Object\Tests\Fixtures\Team;
13
use Rafrsr\LibArray2Object\Writer\AccessorWriter;
14
15
class AccessorWriterTest extends \PHPUnit_Framework_TestCase
16
{
17
    public function testIsWritable()
18
    {
19
        $writer = new AccessorWriter();
20
        static::assertTrue($writer->isWritable(new Team(), 'name'));
21
        static::assertFalse($writer->isWritable(new Team(), 'id'));
22
    }
23
24
    public function testSetValue()
25
    {
26
        $writer = new AccessorWriter();
27
        $team = new Team();
28
        $writer->setValue($team, 'name', 'New Name');
29
        static::assertEquals('New Name', $team->getName());
30
    }
31
}
32