You want two of these checks, one for phantomjs and then a second for casperjs.  No need to assume they're both installed as a transaction.