Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
sfolador committed Nov 22, 2024
2 parents 0f159ff + 4688234 commit fa1aca5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/MeasuresServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function configurePackage(Package $package): void
public function registeringPackage(): void
{
$this->app->bind(MeasuresInterface::class, function () {
return new Measures();
return new Measures;
});
}
}
26 changes: 13 additions & 13 deletions tests/MeasuresTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,79 +17,79 @@
use Sfolador\Measures\Unit\Weight\Weight;

it('can be instantiated', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures)->toBeInstanceOf(Measures::class);
});

it('can convert length', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->length('2.0m'))->toBeInstanceOf(Length::class);
});

it('can convert weight', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->weight('2.0g'))->toBeInstanceOf(Weight::class);
});

it('can convert volume', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->volume('2.0l'))->toBeInstanceOf(Volume::class);
});

it('can convert a temperature', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->temperature('200ºC'))->toBeInstanceOf(Temperature::class);
});

it('can convert an area', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->area('200km2'))->toBeInstanceOf(Area::class);
});

it('can convert a speed', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->speed('100 Km/h'))->toBeInstanceOf(Speed::class);
});

it('can convert a time', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->time('1 ns'))->toBeInstanceOf(Time::class);
});

it('can convert a pressure', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->pressure('1 pa'))->toBeInstanceOf(Pressure::class);
});

it('can convert an energy', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->energy('1 J'))->toBeInstanceOf(Energy::class);
});

it('can convert a power', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->power('1 W'))->toBeInstanceOf(Power::class);
});

it('can convert an angle', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->angle('1 rad'))->toBeInstanceOf(Angle::class);
});

it('can convert data', function () {
$measures = new Measures();
$measures = new Measures;

expect($measures->data('1 B'))->toBeInstanceOf(Data::class);
});
Expand Down
3 changes: 0 additions & 3 deletions tests/Pressure/PressureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
->and(round($bar->toInchesOfMercury()->value, 2))->toBe(29.53);
});




it('can convert millibar to pascal', function () {
$mbar = Pressure::from('1 mbar');

Expand Down

0 comments on commit fa1aca5

Please sign in to comment.