Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
1271 committed Jan 30, 2017
1 parent 8c660c6 commit c950f92
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/Tests/TempTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Test;

use Deimos\Temp\File;

class TempTest extends \PHPUnit_Framework_TestCase
{
public function testTemp()
{
$content = uniqid(mt_rand(), true);

$temp = new File('These data will be overwritten below');

$temp->write($content);

$this->assertEquals(
$temp->read(),
$content
);
$this->assertEquals(
file_get_contents('' . $temp),
$content
);

$data = ' need more data!';
$temp->puts($data);

$this->assertEquals(
$temp->read(),
$content . $data
);

$temp->delete();
$this->assertFalse(is_file('' . $temp));
}
}

0 comments on commit c950f92

Please sign in to comment.