I have a script that throws exceptions when something goes wrong. However, for the purposes of testing I also want to capture specific points although I'm not sure whether they would be deemed errors or not.Below is an example:if ($model->fetchCurrentlyProcessing() > 0) {    throw new App_Exception_CurrentProcess('There is a currently process running. Stopping process.');}if ($model->fetchQueuedItems() == 0) {    throw new App_Exception_NothingInQueue('Nothing in queue. Stopping process.');}In my tests I want to mock the response from these $model methods and detect which exception was thrown, and whether it was the expected exception or not. By throwing exceptions in these cases I can identify exactly at what point the script stopped. But I'm not sure if this is the correct usage of Exceptions as these possible aren't errors to be precise, as in nothing went wrong.
Are exceptions only for handling errors?
php;exceptions;error handling
An exception signifies an exceptional situation due to which a piece of code stops working.  This may be an error, but it may also be any other situation which is exceptional and it prevents the code from doing its job.So, both of your examples appear very good cases of exceptions to me: your code is supposed to do a certain job, and it cannot do it, so it throws an exception.What it boils down to is how you define an exceptional situation, and by extension, how you describe what your code does.  If you call your code process items in queue, then not finding any items in the queue is an exceptional situation.  If you call your code process queued items, if any, then not finding any items in the queue is not an exceptional situation.