B
B
BonBon Slick2018-12-02 11:37:00
Software testing
BonBon Slick, 2018-12-02 11:37:00

Is there any standard or best practices for using assertSame , assertEquals , assertTrue and others similar?

In fact, you can use each of

$shouldBeClass = UploadedFile::class;
    $actualClass   = \get_class($instance->file());
    static::assertSame(
      $shouldBeClass,
      $actualClass,
      \sprintf('Should be %s got %s', $shouldBeClass, $actualClass)
    );

// or

 static::assertTrue(
      $shouldBeClass === $actualClass,
      \sprintf('Should be %s got %s', $shouldBeClass, $actualClass)
    );

// else ...

While it is possible to use other methods in conjunction with the simple php methods, is there a guide for what what when?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kn0ckn0ck, 2018-12-02
@kn0ckn0ck

So, someone needs to learn the equality / inequality operators ... in the sense of identical equality and ordinary equality, well, that is, === or ==, more

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question