• Stars
    star
    6,978
  • Rank 5,613 (Top 0.2 %)
  • Language
    PHP
  • License
    BSD 3-Clause "New...
  • Created about 11 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Provides the functionality to compare PHP values for equality.

Latest Stable Version CI Status Type Coverage codecov

sebastian/comparator

This component provides the functionality to compare PHP values for equality.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require sebastian/comparator

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

composer require --dev sebastian/comparator

Usage

<?php
use SebastianBergmann\Comparator\Factory;
use SebastianBergmann\Comparator\ComparisonFailure;

$date1 = new DateTime('2013-03-29 04:13:35', new DateTimeZone('America/New_York'));
$date2 = new DateTime('2013-03-29 03:13:35', new DateTimeZone('America/Chicago'));

$factory = new Factory;
$comparator = $factory->getComparatorFor($date1, $date2);

try {
    $comparator->assertEquals($date1, $date2);
    print "Dates match";
} catch (ComparisonFailure $failure) {
    print "Dates don't match";
}

More Repositories

1

phpunit

The PHP Unit Testing framework.
PHP
19,646
star
2

php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.
PHP
8,645
star
3

php-timer

Utility class for timing
PHP
7,635
star
4

diff

Diff implementation
PHP
7,551
star
5

php-file-iterator

FilterIterator implementation that filters files based on a list of suffixes, prefixes, and other exclusion criteria.
PHP
7,405
star
6

php-text-template

A simple template engine.
PHP
7,350
star
7

environment

Provides functionality that helps writing PHP code that has runtime-specific execution paths
PHP
6,713
star
8

exporter

Provides the functionality to export PHP variables for visualization
PHP
6,712
star
9

global-state

Snapshotting of global state, factored out of PHPUnit into a stand-alone component
PHP
6,547
star
10

code-unit-reverse-lookup

Looks up which function or method a line of code belongs to
PHP
6,529
star
11

recursion-context

Provides functionality to recursively process PHP variables
PHP
6,518
star
12

php-token-stream

Wrapper around PHP's tokenizer extension.
PHP
6,444
star
13

version

Library that helps with managing the version number of Git-hosted PHP projects
PHP
6,415
star
14

object-enumerator

Traverses array structures and object graphs to enumerate all referenced objects
PHP
6,290
star
15

resource-operations

Provides a list of PHP built-in functions that operate on resources
PHP
6,186
star
16

object-reflector

Allows reflection of object attributes, including inherited and non-public ones
PHP
6,074
star
17

phpunit-mock-objects

Mock Object library for PHPUnit
PHP
4,975
star
18

phploc

A tool for quickly measuring the size of a PHP project.
PHP
2,277
star
19

phpcpd

Copy/Paste Detector (CPD) for PHP code.
PHP
2,228
star
20

type

Collection of value objects that represent the types of the PHP type system
PHP
1,182
star
21

php-invoker

Invoke PHP callables with a timeout
PHP
1,023
star
22

complexity

Library for calculating the complexity of PHP code units
PHP
916
star
23

cli-parser

Library for parsing CLI options
PHP
862
star
24

code-unit

Collection of value objects that represent the PHP code units
PHP
860
star
25

lines-of-code

Library for counting the lines of code in PHP source code
PHP
834
star
26

money

Value Object that represents a monetary value (using a currency's smallest unit).
PHP
734
star
27

php-jenkins-template

Template for Jenkins jobs for PHP projects
522
star
28

object-graph

Provides useful operations on PHP object graphs
PHP
451
star
29

phpdcd

Dead Code Detector (DCD) for PHP code.
PHP
407
star
30

finder-facade

Convenience wrapper for Symfony's Finder component
PHP
253
star
31

state

The State design pattern. Implemented in PHP and with style.
PHP
230
star
32

dbunit

DbUnit port for PHP/PHPUnit.
PHP
225
star
33

phpcov

TextUI frontend for php-code-coverage
PHP
202
star
34

phpunit-documentation

Documentation for PHPUnit.
HTML
189
star
35

phpunit-skeleton-generator

Tool that can generate skeleton test classes from production code classes and vice versa.
PHP
159
star
36

foal

Tool to find lines eliminated by OpCache's bytecode optimizer
PHP
125
star
37

git

Simple PHP wrapper for Git
PHP
124
star
38

de-legacy-fy

Tool for dealing with legacy PHP code
PHP
76
star
39

phpunit-documentation-english

English Documentation for PHPUnit
PHP
70
star
40

container-amiga-gcc

Containerfile for AmigaOS Cross-Compiler Toolchain
PHP
54
star
41

peek-and-poke

Proxy for accessing non-public attributes and methods of an object
PHP
36
star
42

phpunit-documentation-chinese

Simplified Chinese Documentation for PHPUnit
Python
35
star
43

shaku

Tool to automatically generate type-safe Collection and CollectionIterator classes
PHP
32
star
44

csv-parser

Library for type-safe parsing of CSV files
PHP
30
star
45

uuid

Function for generating a UUID (as string)
PHP
26
star
46

docker-execute-amiga

Execute M68K/AmigaOS binary in Docker-ized FS-UAE
Shell
25
star
47

raytracer

Code written while reading the book "The Ray Tracer Challenge: A Test-Driven Guide to Your First 3D Renderer" by Jamis Buck.
PHP
21
star
48

phar-site-generator

A tool that generates an HTML page, RSS feed, and Phive metadata for a PHAR repository
PHP
20
star
49

phpunit-documentation-russian

Russian Documentation for PHPUnit
Python
17
star
50

bugminer

Mines a source code repository for bug and churn information.
PHP
16
star
51

pdepend-process

Processor for PHP_Depend data
PHP
14
star
52

sebastianbergmann

14
star
53

phpunit-documentation-japanese

Japanese Documentation for PHPUnit
Python
13
star
54

phpunit-mink-trait

Trait that provides a minimal integration layer for using Mink in PHPUnit test cases
PHP
12
star
55

phpunit-website

https://phpunit.de/
HTML
12
star
56

phpunit-documentation-french

French Documentation for PHPUnit
Python
11
star
57

phpunit-documentation-brazilian-portuguese

Brazilian Portuguese Documentation for PHPUnit
Python
10
star
58

docker-amigaos-cross-toolchain

Dockerfile for AmigaOS Cross-Compiler Toolchain
PHP
9
star
59

phpunit-memprof-listener

Test Listener for PHPUnit that can dump memory profile information
PHP
9
star
60

phpunit-runner

Proof-of-Concept for new PHPUnit test runner
PHP
8
star
61

xdebug-trace-util

Collection of value objects, filters, etc. for working with Xdebug function traces
PHP
7
star
62

phpunit-example-extension

Example of an extension for PHPUnit
PHP
6
star
63

phpunit-kata-prime-factors

This is a port of Robert C. Martin's Prime Factors kata to PHP and with unit tests written using PHPUnit
PHP
6
star
64

die-kathedrale

PHP
6
star
65

phpunit-test-report

Generates a combined test result / code coverage report in HTML format
5
star
66

container-amitools

Containerfile for Christian Vogelgsang's amitools
PHP
4
star
67

test-mapper

A tool that visualizes the information of PHPUnit's "covers" and "uses" annotations
PHP
4
star
68

phpunit-documentation-spanish

Spanish Documentation for PHPUnit
Python
3
star
69

phptok

TextUI frontend for PHP_TokenStream
PHP
3
star