Migrate test phase into a class

Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>