2017 © Pedro Peláez
 

library phpspec-file-matcher

PHPSpec extension that adds file matcher

image

ecomdev/phpspec-file-matcher

PHPSpec extension that adds file matcher

  • Thursday, September 15, 2016
  • by IvanChepurnyi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 72 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 7 % Grown

The README.md

PHPSpec File Matcher Build Status Coverage Status

Allows to match directory/file existence and basic file content match., (*1)

Installation

  1. Add composer dependency, (*2)

    composer require --dev "ecomdev/phpspec-file-matcher"
    
  2. Add extension to your PHPSpec configuration, (*3)

    extensions:
      EcomDev\PHPSpec\FileMatcher\Extension: ~
    

Matchers

  • Directory existence:, (*4)

    • shouldCreateDirectory($path)
    • shouldBeDirectory($path)
    • shouldHaveDirectory($path)
  • File existence:, (*5)

    • shouldCreateFile($filePath)
    • shouldBeFile($filePath)
    • shouldHaveFile($filePath)
  • File content:, (*6)

    • shouldCreateFileContent($filePath, $content)
    • shouldHaveFile($filePath, $content)

Example

<?php

namespace spec\Example;

use PhpSpec\ObjectBehavior;

class FileSpec extends ObjectBehavior
{
     function it_creates_a_file_on_save()
     {
         $this->save('file.txt', 'some_nice_content')
            ->shouldCreateFile('file.txt')
            ->shouldHaveFileContent('file.txt', 'some_nice_content');
     }
}

The Versions

15/09 2016

dev-master

9999999-dev

PHPSpec extension that adds file matcher

  Sources   Download

MIT

The Requires

 

The Development Requires

extension phpspec matcher

15/09 2016

2.0.2

2.0.2.0

PHPSpec extension that adds file matcher

  Sources   Download

MIT

The Requires

 

The Development Requires

extension phpspec matcher

15/09 2016

dev-develop

dev-develop

PHPSpec extension that adds file matcher

  Sources   Download

MIT

The Requires

 

The Development Requires

extension phpspec matcher

15/09 2016

2.0.1

2.0.1.0

PHPSpec extension that adds file matcher

  Sources   Download

MIT

The Requires

 

The Development Requires

extension phpspec matcher

15/09 2016

2.0.0

2.0.0.0

PHPSpec extension that adds file matcher

  Sources   Download

MIT

The Requires

 

The Development Requires

extension phpspec matcher

01/03 2016
29/02 2016