Difference between assertEquals and assertSame in PHPUnit?

后端 未结 7 1143
别那么骄傲
别那么骄傲 2021-01-30 18:54

PHPUnit contains an assertEquals() method, but it also has an assertSame() one. At first glance it looks like they do the same thing.

What is the difference between the t

7条回答
  •  伪装坚强ぢ
    2021-01-30 19:43

    Moreover,

    // Passes
    $this->assertSame("123.", "123.");
    $this->assertEquals("123.", "123");
    // Fails
    $this->assertSame("123.", "123");
    

提交回复
热议问题