Code Duplication    Length = 29-29 lines in 2 locations

Tests/Units/NumberTestCase.php 2 locations

@@ 412-440 (lines=29) @@
409
    /*
410
     * Test add associative.
411
     */
412
    public function testAddAssociative()
413
    {
414
        $this
415
            ->given(
416
                $a = $this->fromNative($this->randomNativeNumber())->toInteger(),
417
                $b = $this->fromNative($this->randomNativeNumber())->toReal(),
418
                $c = $this->fromNative($this->randomNativeNumber())->toDecimal()
419
            )
420
            ->then
421
                ->boolean(
422
                    $a->add($b)->add($c)->equals($a->add($b->add($c)))
423
                )->isTrue()
424
                ->boolean(
425
                    $a->add($c)->add($b)->equals($a->add($c->add($b)))
426
                )->isTrue()
427
                ->boolean(
428
                    $b->add($a)->add($c)->equals($b->add($a->add($c)))
429
                )->isTrue()
430
                ->boolean(
431
                    $b->add($c)->add($a)->equals($b->add($c->add($a)))
432
                )->isTrue()
433
                ->boolean(
434
                    $c->add($a)->add($b)->equals($c->add($a->add($b)))
435
                )->isTrue()
436
                ->boolean(
437
                    $c->add($b)->add($a)->equals($c->add($b->add($a)))
438
                )->isTrue()
439
        ;
440
    }
441
442
    /*
443
     * Test add zero.
@@ 593-621 (lines=29) @@
590
    /*
591
     * Test mult associative.
592
     */
593
    public function testMultAssociative()
594
    {
595
        $this
596
            ->given(
597
                $a = $this->fromNative($this->randomNativeNumber())->toInteger(),
598
                $b = $this->fromNative($this->randomNativeNumber())->toReal(),
599
                $c = $this->fromNative($this->randomNativeNumber())->toDecimal()
600
            )
601
            ->then
602
                ->boolean(
603
                    $a->mult($b)->mult($c)->equals($a->mult($b->mult($c)))
604
                )->isTrue()
605
                ->boolean(
606
                    $a->mult($c)->mult($b)->equals($a->mult($c->mult($b)))
607
                )->isTrue()
608
                ->boolean(
609
                    $b->mult($a)->mult($c)->equals($b->mult($a->mult($c)))
610
                )->isTrue()
611
                ->boolean(
612
                    $b->mult($c)->mult($a)->equals($b->mult($c->mult($a)))
613
                )->isTrue()
614
                ->boolean(
615
                    $c->mult($a)->mult($b)->equals($c->mult($a->mult($b)))
616
                )->isTrue()
617
                ->boolean(
618
                    $c->mult($b)->mult($a)->equals($c->mult($b->mult($a)))
619
                )->isTrue()
620
        ;
621
    }
622
623
    /*
624
     * Test mult associative.