Skip to content

Commit a862bea

Browse files
author
Tom Van Herreweghe
committed
Tried mocking proc_open function for coverage
Signed-off-by: Tom Van Herreweghe <[email protected]>
1 parent 6dbc594 commit a862bea

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

Diff for: tests/PHPExif/Adapter/ExiftoolProcOpenTest.php

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
namespace PHPExif\Tests\Adapter {
4+
5+
function proc_open()
6+
{
7+
return false;
8+
}
9+
10+
include __DIR__ . '/../../../lib/PHPExif/Adapter/Exiftool.php';
11+
12+
/**
13+
* @covers \PHPExif\Adapter\Exiftool::<!public>
14+
*/
15+
class ExiftoolProcOpenTest extends \PHPUnit_Framework_TestCase
16+
{
17+
/**
18+
* @var \PHPExif\Adapter\Exiftool
19+
*/
20+
protected $adapter;
21+
22+
public function setUp()
23+
{
24+
$this->adapter = new \PHPExif\Adapter\Exiftool();
25+
}
26+
/**
27+
* @group exiftool
28+
* @covers \PHPExif\Adapter\Exiftool::getCliOutput
29+
*/
30+
public function testGetCliOutput()
31+
{
32+
$reflMethod = new \ReflectionMethod('\PHPExif\Adapter\Exiftool', 'getCliOutput');
33+
$reflMethod->setAccessible(true);
34+
35+
$result = $reflMethod->invoke(
36+
$this->adapter,
37+
sprintf(
38+
'%1$s',
39+
'pwd'
40+
)
41+
);
42+
43+
$this->assertInternalType('string', $result);
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)