Mongolid\ActiveRecordTest::testShouldDelete PHP Method

testShouldDelete() public method

public testShouldDelete ( )
    public function testShouldDelete()
    {
        // Arrage
        $entity = m::mock(ActiveRecord::class . '[getDataMapper,getCollectionName]');
        $dataMapper = m::mock();
        // Act
        $entity->shouldReceive('getDataMapper')->andReturn($dataMapper);
        $entity->shouldReceive('getCollectionName')->andReturn('mongolid');
        $dataMapper->shouldReceive('delete')->once()->with($entity, ['writeConcern' => new WriteConcern(1)])->andReturn(true);
        // Assert
        $this->assertTrue($entity->delete());
    }