mirror of
				https://github.com/Icinga/icingaweb2.git
				synced 2025-11-03 20:54:27 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			663 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			663 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
 | 
						|
 | 
						|
namespace Tests\Icinga\Util;
 | 
						|
 | 
						|
use Icinga\Util\File;
 | 
						|
use Icinga\Test\BaseTestCase;
 | 
						|
 | 
						|
class FileTest extends BaseTestCase
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * @expectedException \Icinga\Exception\NotWritableError
 | 
						|
     */
 | 
						|
    public function testWhetherWritingToNonWritableFilesThrowsAnException()
 | 
						|
    {
 | 
						|
        $file = new File('/dev/null');
 | 
						|
        $file->fwrite('test');
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * @expectedException \Icinga\Exception\NotWritableError
 | 
						|
     */
 | 
						|
    public function testWhetherTruncatingNonWritableFilesThrowsAnException()
 | 
						|
    {
 | 
						|
        $file = new File('/dev/null');
 | 
						|
        $file->ftruncate(0);
 | 
						|
    }
 | 
						|
}
 |