PHP code example of mocking-magician / organic
1. Go to this page and download the library: Download mocking-magician/organic library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mocking-magician / organic example snippets
<?
use \MockingMagician\Organic\Facade\FileSystem;
/** @var \MockingMagician\Organic\Inode\File $file */
$file = FileSystem::getFile('path/to/file.ext');
$file->getDirectoryContainerPath();
$file->getObjectPath();
$file->getRealPath();
$file->getName();
$file->getExtension();
$file->getPermissions();
$file->getAccessTime();
$file->getModificationTime();
$file->getChangeTime();
$file->getSize();
/** @var MockingMagician\Organic\IO\IOFile $io */
$io = $file->getIO();
$io->write('something');
$io->tell();
$io->truncate(25);
$io->passThrough();
$io->read(250);
$io->getContent();
$io->getChar();
$io->getCurrentLine();
$io->addContent('some data to append');
$io->seek(13);
$io->flush();
$io->eof();
$io->lock(LOCK_EX, $wouldBlock);
$io->putContent('that new content');
$io->scanFormat('FS');
//TODO Continue documentation