1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-26 20:24:39 +01:00

Refactoring tests

This commit is contained in:
Gabriel Caruso 2017-12-07 18:08:19 -02:00
parent a96add4526
commit 8eb7f3a798
5 changed files with 13 additions and 10 deletions

View File

@ -42,8 +42,9 @@ class Functional_Net_SCPSSH2UserStoryTest extends PhpseclibFunctionalTestCase
public function testConstructor($ssh)
{
$scp = new SCP($ssh);
$this->assertTrue(
is_object($scp),
$this->assertInternalType(
'object',
$scp,
'Could not construct \phpseclib\Net\SCP object.'
);
return $scp;

View File

@ -22,7 +22,7 @@ class Functional_Net_SFTPStreamTest extends Functional_Net_SFTPTestCase
'sftp' => ['session' => $this->sftp],
]);
$fp = fopen($this->buildUrl('fooo.txt'), 'wb', false, $context);
$this->assertTrue(is_resource($fp));
$this->assertInternalType('resource', $fp);
fclose($fp);
$this->assertSame(0, $this->sftp->size('fooo.txt'));
}
@ -39,7 +39,7 @@ class Functional_Net_SFTPStreamTest extends Functional_Net_SFTPTestCase
fputs($fp, 'zzzz');
fclose($fp);
$this->assertTrue(in_array('te#st.txt', $this->sftp->nlist()));
$this->assertContains('te#st.txt', $this->sftp->nlist());
}
/**

View File

@ -29,8 +29,9 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
{
$sftp = new SFTP($this->getEnv('SSH_HOSTNAME'));
$this->assertTrue(
is_object($sftp),
$this->assertInternalType(
'object',
$sftp,
'Could not construct NET_SFTP object.'
);

View File

@ -14,8 +14,9 @@ class Functional_Net_SSH2Test extends PhpseclibFunctionalTestCase
{
$ssh = new SSH2($this->getEnv('SSH_HOSTNAME'));
$this->assertTrue(
is_object($ssh),
$this->assertInternalType(
'object',
$ssh,
'Could not construct NET_SSH2 object.'
);

View File

@ -59,7 +59,7 @@ class Unit_File_ANSITest extends PhpseclibTestCase
$screen = $ansi->getScreen();
$lines = explode("\r\n", $screen);
$this->assertSame(24, count($lines));
$this->assertCount(24, $lines);
$this->assertSame(str_repeat('z', 80), $lines[22]);
}
}
}