phpcs fixes

and add a test for when deleting should fail