- gitlist.git
- tests
- Gitlist
- RepositoryTest.php
This file ( 1kB ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
<?php
use Gitter\Client;
use Gitter\Repository;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
class RepositoryTest extends TestCase
{
use ProphecyTrait;
public function testIsSanitizingSearchWithPager()
{
$client = $this->prophesize(Client::class);
$client->run(Argument::type(Repository::class), "grep -i --line-number -- '=sleep 5;' master")->shouldBeCalled();
$repository = new Repository('/tmp', $client->reveal());
$repository->searchTree('--open-files-in-pager=sleep 5;', 'master');
$repository->searchTree('-O=sleep 5;', 'master');
}
public function testIsSanitizingSearchWithAnyOption()
{
$client = $this->prophesize(Client::class);
$client->run(Argument::type(Repository::class), "grep -i --line-number -- 'foobar =bar;' foo")->shouldBeCalled();
$repository = new Repository('/tmp', $client->reveal());
$repository->searchTree('foobar --bar --foo=bar;', 'foo');
}
}