3 * This file is part of sebastian/diff.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace SebastianBergmann\Diff;
13 use PHPUnit\Framework\TestCase;
16 * @covers SebastianBergmann\Diff\Diff
18 * @uses SebastianBergmann\Diff\Chunk
20 final class DiffTest extends TestCase
22 public function testGettersAfterConstructionWithDefault()
26 $diff = new Diff($from, $to);
28 $this->assertSame($from, $diff->getFrom());
29 $this->assertSame($to, $diff->getTo());
30 $this->assertSame(array(), $diff->getChunks(), 'Expect chunks to be default value "array()".');
33 public function testGettersAfterConstructionWithChunks()
37 $chunks = array(new Chunk(), new Chunk(2, 3));
39 $diff = new Diff($from, $to, $chunks);
41 $this->assertSame($from, $diff->getFrom());
42 $this->assertSame($to, $diff->getTo());
43 $this->assertSame($chunks, $diff->getChunks(), 'Expect chunks to be passed value.');
46 public function testSetChunksAfterConstruction()
48 $diff = new Diff('line1c', 'line2c');
49 $this->assertSame(array(), $diff->getChunks(), 'Expect chunks to be default value "array()".');
51 $chunks = array(new Chunk(), new Chunk(2, 3));
52 $diff->setChunks($chunks);
53 $this->assertSame($chunks, $diff->getChunks(), 'Expect chunks to be passed value.');