PHP code example of lhsazevedo / sh4objtest
1. Go to this page and download the library: Download lhsazevedo/sh4objtest 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/ */
lhsazevedo / sh4objtest example snippets
# example_test.php
use Lhsazevedo\Sh4ObjTest\TestCase;
return new class extends TestCase {
public function test_exampleFunction() {
// Set up initial memory state
$someAddress = $this->alloc(4);
$this->initUint32($someAddress, 0x1234);
// Define expected function calls
$this->shouldCall('_someFunction')
->with(0x1234)
->andReturn(0x5678);
// Define expected memory writes
$this->shouldWrite($someAddress, 0x5678);
// Run the function under test
$this->call('_functionUnderTest')
->with($someAddress)
->run();
}
};