Merge pull request #11 from bessl/patch-2
[gitphp.git] / test / git / blob / BlobLoad_RawTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
 * Raw blob load test class
 *
 * @author Christopher Han <xiphux@gmail.com>
 * @copyright Copyright (c) 2012 Christopher Han
 * @package GitPHP
 * @subpackage Git\Test\Blob
 */
class GitPHP_BlobLoad_RawTest extends PHPUnit_Framework_TestCase
{
        public function testLoad()
        {
                $blobmock = $this->getMockBuilder('GitPHP_Blob')->disableOriginalConstructor()->getMock();
                $blobmock->expects($this->any())->method('GetHash')->will($this->returnValue('1234567890abcdef1234567890ABCDEF12345678'));
                $loadermock = $this->getMockBuilder('GitPHP_GitObjectLoader')->disableOriginalConstructor()->getMock();
                $loadermock->expects($this->once())->method('GetObject')->with($this->equalTo('1234567890abcdef1234567890ABCDEF12345678'))->will($this->returnValue("blob line 1\nblob line 2"));
 
                $strategy = new GitPHP_BlobLoad_Raw($loadermock);
                $this->assertEquals("blob line 1\nblob line 2", $strategy->Load($blobmock));
        }
}
 
comments