unit testing for downloading a file
===

First of all i'm using codeigniter as my PHP Framework. Sorry for asking this, i'm trying to grasp the idea of unit testing. They said that its a good practice to do unit testing before developing your site functionality. So here I am eager to learn this:

My method:

    function download()
	{
		$data = file_get_contents("resources/temp/file.doc");
		$name = "new_file.doc";
		
		force_download($name, $data);
	}


Then I created a test controller with a testDownload method:

    public function testDownload()
	{		
		//Call the controller method
		$this->CI->download();
		
		//Fetch the buffered output
		$out = output();
		
		$this->assertFalse(preg_match('/(error|notice)/i', $out));
	}

Then I test it: phpunit test.php and gave me this: 

    F[CIUnit] PHP Error: Warning - file_get_contents(resources/temp/file.doc): failed to open stream: No such file or directory File Path: controllers/contract.php (line: 22)


    Time: 4 seconds, Memory: 7.50Mb

    There was 1 failure:

    1) ContractTest::testDownload
    Failed asserting that 0 is false.


I just want to test whether it has the correct path. or maybe do I really need a test script for downloading a file? Sorry, im just confused.
