File: KeepFilterTest.php

package info (click to toggle)
php-deepcopy 1.13.4-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 612 kB
  • sloc: php: 1,793; makefile: 26
file content (26 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php declare(strict_types=1);

namespace DeepCopyTest\Filter;

use DeepCopy\Filter\KeepFilter;
use PHPUnit\Framework\TestCase;
use stdClass;

/**
 * @covers \DeepCopy\Filter\KeepFilter
 */
class KeepFilterTest extends TestCase
{
    public function test_it_does_not_change_the_filtered_object_property()
    {
        $object = new stdClass();
        $keepObject = new stdClass();
        $object->foo = $keepObject;

        $filter = new KeepFilter();

        $filter->apply($object, 'foo', null);

        $this->assertSame($keepObject, $object->foo);
    }
}