Coder Social home page Coder Social logo

spectrum's Introduction

###Spectrum Spectrum is a PHP framework for BDD specification test.

Current version is alpha and not stable.

Documentation (for a while only on Russian): http://mkharitonov.net/spectrum/ https://bitbucket.org/mkharitonov/spectrum-framework.org/src

###Examples: <?php require_once DIR . '/spectrum/init.php';

describe('AddressBook', function(){
	beforeEach(function(){
		// Use "world()" instead of "$this" in php 5.3, "$this" available only in php >= 5.4
		$this->addressBook = new AddressBook();
	});

	context('"MySql" driver', function(){
		beforeEach(function(){
			$this->addressBook->setDriver(new drivers\MySql());
		});
	});

	context('"Files" driver', function(){
		beforeEach(function(){
			$this->addressBook->setDriver(new drivers\Files());
		});
	});

	it('Should find person by first name', function(){
		the($this->addressBook->findPerson('Bob')->firstName)->eq('Bob');
	});

	it('Should find person by phone number', array(
		'+7 (495) 123-456-7',
		'(495) 123-456-7',
		'123-456-7',
	), function($phoneNumber){
		the($this->addressBook->findPerson($phoneNumber)->phoneNumber)->eq('+74951234567');
	});
});

\spectrum\RootDescribe::run();

Result:

  1. AddressBook — success
    1. "MySql" driver — success
      1. Should find person by first name — success
      2. Should find person by phone number — success
        1. +7 (495) 123-456-7 — success
        2. (495) 123-456-7 — success
        3. 123-456-7 — success
    2. "Files" driver — success
      1. Should find person by first name — success
      2. Should find person by phone number — success
        1. +7 (495) 123-456-7 — success
        2. (495) 123-456-7 — success
        3. 123-456-7 — success

###Copyright (c) Mikhail Kharitonov [email protected]

For the full copyright and license information, see the LICENSE.txt file.

spectrum's People

Contributors

m-haritonov-test avatar

Stargazers

Eric avatar

Watchers

James Cloos avatar Eric avatar

Forkers

pavlovt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.