When you use an accrual method of accounting, your financial statements reflect that you recognize income when you earn it and expenses when you incur them. The all events test is a standard for determining when an item of income or expense should be included on your income tax return.
Income inclusion is covered in Regulation 1.451-1(a), and requires you to recognize income under an accrual method based on the right to receive the income and the ability to determine the amount of the income to be received.
For deductions, there’s another requirement: you must also have actually delivered the property or performed the service. The all events test for deductions is found in Regulation 1.461-1(a)(2), which also allows an exception for recurring items.