PHP code example of sebkay / touchstone

1. Go to this page and download the library: Download sebkay/touchstone 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/ */

    

sebkay / touchstone example snippets




namespace WPTS\Tests\Unit;

class ExampleUnitTest extends UnitTest
{
    public function test_it_works()
    {
        $this->assertTrue(true);
    }
}



namespace WPTS\Tests\Integration;

class ExampleIntegrationTest extends IntegrationTest
{
    public function test_post_title_was_added()
    {
        $post_id = $this->factory()->post->create([
            'post_title' => 'Example post title',
        ]);

        $post = \get_post($post_id);

        $this->assertSame('Example post title', $post->post_title);
    }
}


# config.touchstone.php

return [
    'directories' => [
        'all'         => 'tests',
        'unit'        => 'tests/Unit',
        'integration' => 'tests/Integration',
    ],
];


# config.touchstone.php

return [
    'plugins' => [
        [
            'name' => 'Advanced Custom Fields',
            'file' => dirname(__FILE__) . '/bin/plugins/advanced-custom-fields-pro/acf.php',
        ],
    ],
];


# config.touchstone.php

return [
    'theme' => [
        'root' => dirname(__FILE__) . '/../../themes/twentytwentyone',
    ],
];
shell
tests/
    Unit/
        ExampleUnitTest.php
    Integration/
        ExampleIntegrationTest.php