You've already forked Atomcms-edit
51 lines
1.3 KiB
PHP
Executable File
51 lines
1.3 KiB
PHP
Executable File
<?php
|
|
|
|
test('that true is true', function () {
|
|
expect(true)->toBeTrue();
|
|
expect(true)->toBeBool();
|
|
expect(true)->not->toBeFalse();
|
|
expect(true)->not->toBeNull();
|
|
expect(true)->toEqual(true);
|
|
expect(true === true)->toBeTrue();
|
|
});
|
|
|
|
test('that false is false', function () {
|
|
expect(false)->toBeFalse();
|
|
expect(false)->toBeBool();
|
|
expect(false)->not->toBeTrue();
|
|
expect(false)->not->toBeNull();
|
|
expect(false)->toEqual(false);
|
|
expect(false === false)->toBeTrue();
|
|
});
|
|
|
|
test('that null is null', function () {
|
|
expect(null)->toBeNull();
|
|
expect(null)->not->toBeTrue();
|
|
expect(null)->not->toBeFalse();
|
|
expect(null === null)->toBeTrue();
|
|
});
|
|
|
|
test('basic arithmetic operations', function () {
|
|
expect(1 + 1)->toBe(2);
|
|
expect(2 * 2)->toBe(4);
|
|
expect(10 - 5)->toBe(5);
|
|
expect(8 / 2)->toBe(4);
|
|
expect(10 % 3)->toBe(1);
|
|
});
|
|
|
|
test('string operations', function () {
|
|
expect('hello')->toBeString();
|
|
expect('hello')->toHaveLength(5);
|
|
expect('hello world')->toContain('world');
|
|
expect('hello')->not->toBeEmpty();
|
|
expect('')->toBeEmpty();
|
|
});
|
|
|
|
test('array operations', function () {
|
|
$array = [1, 2, 3];
|
|
expect($array)->toBeArray();
|
|
expect($array)->toHaveCount(3);
|
|
expect($array)->toContain(2);
|
|
expect($array)->not->toBeEmpty();
|
|
});
|