2017 © Pedro Peláez
 

library persisted-objects

Overly simplistic persistance implementations for functional testing

image

everzet/persisted-objects

Overly simplistic persistance implementations for functional testing

  • Monday, February 12, 2018
  • by everzet
  • Repository
  • 6 Watchers
  • 111 Stars
  • 47,450 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

Persisted Objects

This repository is a collection of repositories (pun intended) that somebody might find useful in training or testing exercises. They provide an easy way to create Fakes for your repositories in the test infrastructure., (*1)

Why?

As stated in the header - for testing and demo purposes. These repos are optimised for cases where you have less than 20 records in your repository and there's always only one user accessing it at a time. In these particular cases these repositories are faster. But in every other instance they're exponentially not., (*2)

Usage

Install with:, (*3)

$> composer require --dev everzet/persisted-objects

Use like this:, (*4)

$repo = new FileRepository(TEMP_FILE, new AccessorObjectIdentifier('getId'));
$repo->save($user);

$user === $repo->findById($user->getId());

$repo->clear();

or like this:, (*5)

$repo = new InMemoryRepository(new CallbackObjectIdentifier(
    function($obj) { return $obj->getFirstname() . $obj->getLastname(); }
);
$repo->save($user);

$user === $repo->findById($user->getFirstname() . $user->getLastname());

$repo->clear();

The Versions

12/02 2018

dev-master

9999999-dev https://github.com/everzet/persisted-objects

Overly simplistic persistance implementations for functional testing

  Sources   Download

MIT

The Requires

  • php >5.3,<7.3

 

The Development Requires

repository bdd test ddd persistance

12/02 2018

v1.0.4

1.0.4.0 https://github.com/everzet/persisted-objects

Overly simplistic persistance implementations for functional testing

  Sources   Download

MIT

The Requires

  • php >5.3,<7.3

 

The Development Requires

repository bdd test ddd persistance

23/02 2017

v1.0.3

1.0.3.0 https://github.com/everzet/persisted-objects

Overly simplistic persistance implementations for functional testing

  Sources   Download

MIT

The Requires

  • php >5.3,<7.2

 

The Development Requires

repository bdd test ddd persistance

09/01 2017

v1.0.2

1.0.2.0 https://github.com/everzet/persisted-objects

Overly simplistic persistance implementations for functional testing

  Sources   Download

MIT

The Requires

  • php >5.4,<7.2

 

The Development Requires

repository bdd test ddd persistance

12/08 2015

v1.0.1

1.0.1.0 https://github.com/everzet/persisted-objects

Overly simplistic persistance implementations for functional testing

  Sources   Download

MIT

The Requires

  • php >5.4,<7.1

 

The Development Requires

repository bdd test ddd persistance

19/12 2014

v1.0.0

1.0.0.0 https://github.com/everzet/persisted-objects

Overly simplistic persistance implementations for functional testing

  Sources   Download

MIT

The Requires

  • php ~5.4

 

The Development Requires

repository bdd test ddd persistance