This repository was archived by the owner on Oct 18, 2023. It is now read-only.
Releases: codingpa-ws/pspec
Releases · codingpa-ws/pspec
1.0 — first stable release
The first stable release of PSpec. The main goal from the start date onwards is to add tests and documentation but also a few more new matchers. This makes PSpec easy to get started with.
Main updates
- ✨ Making PSpec stable & easy to use
- 🔧 Simple configuration
- 📖 Docs on how to use PSpec: https://codingpaws.gitlab.io/pspec/
Future plans
Pre-release v0.2
Merge branch 'Fix-vendor/bin/pspec-doesn’t-require-autoload' into 'main' Fix vendor/bin/pspec doesn’t require autoload See merge request codingpaws/pspec!26
Release 0.1
PSpec
PSpec is a testing framework for PHP, influenced by RSpec and
jest.
Example
// src/Counter.php
class Counter {
public int $value = 0;
function increment() {
$this->value++;
}
}
// spec/Counter.spec.php
describe(Counter::class, function () {
subject(fn () => new Counter);
let('base_value', 10);
before(function () {
subject()->value = $this->base_value;
});
describe('#increment', function () {
it('increments by 1', function () {
expect(subject()->value)->toBe($this->base_value);
subject()->increment();
expect(subject()->value)->toBe($this->base_value + 1);
});
});
});