1<?php 2/* 3 * This file is part of sebastian/diff. 4 * 5 * (c) Sebastian Bergmann <sebastian@phpunit.de> 6 * 7 * For the full copyright and license information, please view the LICENSE 8 * file that was distributed with this source code. 9 */ 10 11namespace SebastianBergmann\Diff; 12 13use PHPUnit\Framework\TestCase; 14 15/** 16 * @covers SebastianBergmann\Diff\Chunk 17 */ 18class ChunkTest extends TestCase 19{ 20 /** 21 * @var Chunk 22 */ 23 private $chunk; 24 25 protected function setUp() 26 { 27 $this->chunk = new Chunk; 28 } 29 30 public function testCanBeCreatedWithoutArguments() 31 { 32 $this->assertInstanceOf('SebastianBergmann\Diff\Chunk', $this->chunk); 33 } 34 35 public function testStartCanBeRetrieved() 36 { 37 $this->assertEquals(0, $this->chunk->getStart()); 38 } 39 40 public function testStartRangeCanBeRetrieved() 41 { 42 $this->assertEquals(1, $this->chunk->getStartRange()); 43 } 44 45 public function testEndCanBeRetrieved() 46 { 47 $this->assertEquals(0, $this->chunk->getEnd()); 48 } 49 50 public function testEndRangeCanBeRetrieved() 51 { 52 $this->assertEquals(1, $this->chunk->getEndRange()); 53 } 54 55 public function testLinesCanBeRetrieved() 56 { 57 $this->assertEquals(array(), $this->chunk->getLines()); 58 } 59 60 public function testLinesCanBeSet() 61 { 62 $this->assertEquals(array(), $this->chunk->getLines()); 63 64 $testValue = array('line0', 'line1'); 65 $this->chunk->setLines($testValue); 66 $this->assertEquals($testValue, $this->chunk->getLines()); 67 } 68} 69