PHP code example of savvywombat / laravel-assert-selector-contains

1. Go to this page and download the library: Download savvywombat/laravel-assert-selector-contains 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/ */

    

savvywombat / laravel-assert-selector-contains example snippets


namespace Tests\Feature;

use SavvyWombat\LaravelAssertSelectorContains\AssertsWithSelectors;
use Tests\TestCase;

class ExampleTest extends TestCase
{
  use AssertsWithSelectors;

  public function testDocumentTitleIsCorrect(): void
  {
    $response = $this->get('/');
    
    $response->assertSelectorContains('title', 'Welcome');
  }
}

assertSelectorExists($selector)
assertSelectorDoesNotExist($selector)

assertSelectorContains($selector, $value)
assertSelectorDoesNotContain($selector, $value)

assertSelectorAttributeExists($selector, $attribute)
assertSelectorAttributeDoesNotExist($selector, $attribute)

assertSelectorAttributeEquals($selector, $attribute, $value)
assertSelectorAttributeDoesNotEqual($selector, $attribute, $value)

assertSelectorAttributeContains($selector, $attribute, $value)
assertSelectorAttributeDoesNotContain($selector, $attribute, $value)